A San Francisco police officer was shot in the head Friday evening in the city's Taraval District and a suspect was in custody, according to reports.

KTVU reported that the officer was conscious and breathing and was expected to survive. The officer was taken to San Francisco General Hospital after the shooting.

The incident began at around 8:15 p.m. local time when police responded to a report related to a mentally disturbed individual. KGO-TV reported that police tried to confront the individual who reportedly pulled out a handgun and opened fire, striking the officer.

Police issued a shelter-in-place order for the area as they pursued the suspect, who had reportedly fled the scene.

“This brave officer was doing his job, protecting the citizens of San Francisco, when he was struck by a bullet tonight,” Martin Halloran, president of the San Francisco Police Officers Association said in a statement. “For his courage, he deserves all our gratitude and respect. Please keep him in your prayers tonight.”

Police cornered the suspect about an hour after the shooting. SWAT units deployed non-lethal flash bang grenades and then apprehend the suspect.

It was not immediately clear what condition the suspect was in or whether he was injured in the exchange of fire with police. However, Officer Carlos Manfredi said the suspect was also at San Francisco General.

San Francisco Mayor Ed Lee spoke briefly to the media, saying he was grateful to the police department and that the officer was in good spirits.

“I had a chance to thank him and meet his family. I’m very grateful,” Lee said.

Click for more from KTVU.com.