The man was crossing the road near the intersection of Randolph and Ramsell streets when he was hit by an M Ocean View line train at about 4:30 p.m.
He was trapped beneath the train and San Francisco Fire Department crews responded to lift the light rail vehicle and free him. Police spokesman Officer Boaz Mariles said he was taken to the hospital to be treated for serious injuries.
Shuttles temporarily took passengers in both directions between Geneva and San Jose avenues and the West Portal Muni station.
Muni spokeswoman Kristen Holland said the intersection was clear and regular service had resumed by about 6:15 p.m.
As per standard procedure, the train's operator will be drug tested and placed on non-driving status pending an investigation into the incident, Holland said.