Just after 11 p.m. Thursday night, San Francisco police responded to reports of shots fired in the 400 block of Ninth Street, according to police.
Arriving officers heard multiple gunshots fired and set up a perimeter around the block, police said.
SFPD's tactical unit and SWAT team responded, along with the California Highway Patrol and San Francisco fire units, police said.
Just before 11:10 p.m. Thursday night cars at the intersection of Ninth and Bryant streets were quickly ushered through the area as three or four police officers crouched behind a marked patrol car with its lights on. Three shots were heard and police appeared to have drawn their weapons toward a building at the northwest corner of Ninth and Bryant streets.
Once police had surrounded the building no further shots were fired and by 1:15 a.m. two male suspects came out to the street and were detained, police said.
A suspect is believed to have fired a rifle from the building, police said.
No injuries were reported and police remained at the scene as of 1:20 a.m. to clear the building.
Nearby roads had been closed during the incident, including 10th Street between Bryant and Harrison streets; Bryant Street between Ninth and 10th streets; and Harrison Street between Ninth and 10th streets, according to police.