The suspect was spotted with the weapon around 10:45 p.m. in the first block of Sixth Street, police said.
When police approached the person, the suspect fled into a building.
The area around Sixth and Mission streets was evacuated and traffic was closed to vehicles and pedestrians while officers searched for the suspect, police said.
Officers eventually detained three suspects, according to police.
The investigation is ongoing.