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.

Paramedics transported the victim to a nearby hospital.

Trains headed toward the area were turned back at neighboring stations, and a bus bridge operated through the area as the scene was cleared for about an hour, according to MTA spokesman Paul Rose.

The victim’s injuries were not life-threatening, police said, and he was able to talk to investigators Thursday.

As standard procedure, the Muni operator was tested for drugs and alcohol, the results of which were not immediately disclosed.