The victim was walking in the Mission District Friday when a car pulled up and someone inside opened fire with a B.B. gun.
The man was hit in the face, but refused medical treatment.
He called police who quickly arrested the three men.
Police believe the 23-year-old suspects, all cousins, targeted the victim because they thought he was gay.
Police say they found a video camera in their possession that was used to film the attack.
Police are asking others to come forward if they were victims of similar attacks.