Officers rushed to the area of Capra and Mallorca ways around 12:30 pm. after someone saw an armed man beating another person.
It all began in front of a Bank of America ATM at Pierce and Chestnut when a fight broke out between two people and quickly escalated.
"I heard someone from the second floor yelling for help, I called police," witness Tim McKean said.
McKean heard the commotion from his apartment near the ATM on Pierce St. He was shocked to see a man with a gun beating another man holding onto a backpack.
"He was telling the guy to give up the bag or whatnot," McKean said. "He had a silver gun in his left hand. Attempting to get the bag away he pistol-whipped the guy, hitting him in the head. Simultaneously, the gun went off."
Whitney Persek heard the gunfire from the Chestnut St. clothing store she manages.
"I was absolutely panicked," she said. "But I tried to stay calm cause I had customers in store. So as soon as I heard gunshots I closed the door, got my customers upstairs, and just kind of looked out the window up there. But I didn't want to be down here with the glass and everything."
Several rounds were fired. It's not known if the man with the backpack was hit; he quickly left in a waiting car.
But the armed suspect took off on foot, running several blocks toward Mallorca Way where police officers cornered him behind a bush, ordering him to come out.
"At some point in time the suspect fled the bush and as he was proceeding northbound he turned the gun on the officers, several officers discharged their weapons, the suspect was hit at least one time," SFPD Chief Greg Suhr said.
The suspect was taken to the hospital in serious condition.
All of this unfolding on a busy Sunday in a neighborhood were violent crime is almost unheard of.
"This is crazy," witness Pamela McGarry said. "This is a great, safe neighborhood. It's amazing, it's a wonderful neighborhood."
Persek says she now fears for her safety, "You come to live in this neighborhood because it's safe and you want to feel safe and you want to feel like you can walk around. But I don't really feel that way anymore. I don't want to walk home by myself. I feel like I need an escort. Now that's really unfortunate."
No police officers were injured.
The man with the backpack who was pistol-whipped was found a short time later outside of San Francisco. Police are interviewing him, trying to determine his role in this chaotic situation.
Anyone with information is urged to call San Francisco police at (415) 553-1145 or the anonymous tip line at (415) 575-4444.