By Howard Monroe

PHILADELPHIA (CBS) – Philadelphia police are investigating after an officer shot a man inside the 39th District Headquarters. This is after they say a man attempted to stab an officer with a screwdriver.

The situation all unfolded just after 9 a.m. Wednesday inside the 39th District. Police say a 23-year-old man entered the building on Hunting Park Avenue in Nicetown wearing a mask. He walked up to a glass barrier in the lobby and asked the officers something.

READ MORE: 5-Year-Old Boy Injured In North Philadelphia Shooting, Police Say

Police say they couldn’t hear what he wanted, so they opened a locked door to their operations room. That is when police say he lunged at them with a screwdriver in his hand. He began fighting with two officers and then a third officer shot the suspect, hitting him in the torso.

One of the officers suffered injuries to the back of the head. The officer had injuries to his arm, elbow and hand. It’s not clear if either officer was stabbed.

Both officers were rushed to Temple University Hospital following the attack. Police commissioner Danielle Outlaw visited them and says they are in good spirits.

After these types of incidents, a group of chaplains visits officers in the hospital and at the police headquarters.

READ MORE: EXCLUSIVE: Teen Pilot Who Landed Plane On Bridge In Ocean City Shares How He Survived New Mexico Plane Crash

“Praise God it’s not worse than it was. That’s the best I can say. I’ve been at situations where we didn’t know if officers were going to make it or not, and some didn’t make it. But we praise God this is not as serious as it could be,” Philadelphia Police Chaplain Rev. Frank Crangle.

Police have not said if the officers have been released from the hospital. The suspect was taken in for surgery.

The district attorney will make the final decision on any potential charges.

Eyewitness News has been told the shooting officer has been placed on administrative duty after the incident.

MORE NEWS: Police: 4-Year-Old In Stable But Critical Condition After Being Struck By SUV In West Philly

CBS3’s Wakisha Bailey contributed to this report.