Instead of calling an ambulance, the bus driver drove the victim to San Francisco General Hospital, where the bus could be seen parked in the lot with two bullet holes in a rear left window.
The driver did not want to talk about the ordeal and was escorted away by Muni staff.
Members of the gang task force say three men fired into the bus just after 2 p.m. in the city's Potrero Hill neighborhood at 25th St. and Wisconsin.
Police initially said that three men boarded the bus there then got off and began firing shots at the bus. Later, a police spokesman said they now believe the shooters may not have boarded the bus, but simply began firing from outside the stopped bus.
"After the shooting had just occurred, the bus driver was smart enough to leave the scene immediately, noticed that that there was an injured victim in the back, drove the bus straight to General Hospital so that way, they can work on the victim," said SFPD spokesman Carlos Manfredi.
Officials say the victim, who was either grazed by a bullet or injured by flying glass, was being treated for a "superficial wound."
Officers from the gang task force questioned other passengers on the bus at the time of the shooting. They say they don't know whether the victim was targeted or if the incident was a random shooting. They say they're hoping to learn more about what happened from a security camera on the bus.