It happened just before 4:00 a.m., when firefighters got a report of a man pinned under a train at Broadway and Embarcadero.
Firefighters used a hydraulic lift to get the man out from under the front part of the locomotive. Paramedics rushed him to the hospital.
Officials are still trying to determine how he got trapped, but there was a wheelchair nearby.