A rainbow flag flies in front of the iconic Castro Theater during a street celebration following the United States Supreme Court's landmark decision that legalized same-sex marriage throughout the country in San Francisco, California June 26, 2015. REUTERS/Elijah Nouvelage

A bystander has been shot at a gay pride event in San Francisco when an argument between several young men turned violent, police said.

Officer Carlos Manfredi says several people were detained for questioning after the shooting.

There were chaotic scenes after the shooting as dozens of people ran screaming while police officers carrying handguns rushed to the scene.

Mr Manfredi said a 64-year-old man who was caught in the crossfire got shot in the arm. He is in hospital in a stable condition.

Four shots were heard in a witness video posted online.

Police said the argument had nothing to do with the gay pride event.

A concert that was part of the weekend-long gay pride celebration across the city was ending around the time of the shooting.

PA Media