Lea Suzuki / The Chronicle

A San Francisco man suffered a traumatic brain injury after a Muni car hit him Wednesday night outside the UCSF Benioff Children’s Hospital in Potrero Hill, officials said.

The 22-year-old victim had gotten off a Muni train, left the platform and was crossing the street when an inbound M-line train collided with him at 8:19 p.m. at Third and Mariposa streets, according to police and the San Francisco Metropolitan Transportation Agency. He was crossing as the pedestrian walk signal was changing from yellow to red, officials said.