Officers responded to the shooting at the intersection of Broadway and Kearny Street around 1 a.m.
Police said an unknown number of suspects got into a fight with Barrett, a San Francisco resident, who was shot as he tried to run away.
San Francisco police spokesman Sgt. Lyn Tomioka said inspectors are continuing to investigate this morning.
A man who takes reservations at Green Tortoise Hostel, located at 494 Broadway, said this morning hostel staff heard the shooting but did not see what happened.