The stabbing occurred just before 10 a.m. Tuesday near the T-Third Muni platform at Third Street and La Salle Avenue, police spokesman Sgt. Troy Dangerfield said.
The victim suffered injuries that weren't believed to be life-threatening and was taken to a hospital.
Police had initially reported that the stabbing happened on the platform, but Dangerfield clarified today that it occurred on a nearby sidewalk after an argument on the platform.
The suspect, Fred Taylor, of San Francisco, was taken into custody about a block away, at Third Street and Kirkwood Avenue, shortly before 3 p.m., Dangerfield said.
Police believe Taylor argued with the man, then left and came back with a group of friends and stabbed him, Dangerfield said.
Taylor and the victim are known to hang out in the neighborhood, he said.
Service on the T-Third line was briefly stopped after the stabbing because police heard the suspect might have fled on Muni, but that turned out to be incorrect.