Two San Francisco police officers found themselves at the right place, at the right time, late Sunday night.
Two investigators say they were heading back from an assignment when they heard a woman screaming near the intersection of Mission and Fremont Streets.
When they turned the corner, they saw the woman trying to break free from a man trying to steal her purse.
Captain Mark Osuna tells NBC Bay Area the suspect, at one point, threw the woman to the ground.
A police department spokesman says the suspect then pulled out a gun.
One of the officers fired one shot, but no-one was hit.
The suspect was taken into custody without incident.