Police shot a man after he attacked an officer with a screwdriver inside the 39th Police District headquarters in Nicetown, authorities said.

Shortly after 9:15 a.m. Wednesday, a 23-year-old man wearing a mask approached the station’s operations room window and began talking to the officer, said Sgt. Eric Gripp, a police spokesperson. The officer couldn’t hear what the man was saying and opened a side employee entrance door that is key-code-protected.

“As soon as he opens the door, this guy pushes the officer and is lunging into the operations room, armed with a screwdriver,” Gripp said.

Two officers attempted to disarm the man, he said. Another officer shot at the alleged attacker, hitting him in the torso. The man — whom police have not identified — was taken to Temple University Hospital in critical condition.

The incident lasted only about 30 seconds, according to Gripp. There is no surveillance footage inside the office, he said, and the officers were not equipped with stun guns or wearing body cameras, but they were in uniform.

The officer who shot the man is a 32-year-old woman who has worked for the Police Department for seven years, Gripp said. He said the officers did not know the man who attacked them. The officer who shot the man has been placed on administrative duty pending an investigation by police and the/ District Attorney’s Office.

At a news conference Wednesday afternoon, Police Commissioner Danielle Outlaw said police weren’t sure why the man had gone to the police station or where he got the screwdriver.

Two officers were injured — one who suffered cuts and bruises to the head, though not from the screwdriver, and another who injured an arm, hand, and elbow, Gripp said.

The Rev. Frank Crangle, a police chaplain of the 14th District, said he visited the officer with the head injury at Temple Hospital and and found him in “good spirits.”

Outlaw said that she had also visited the officer and that he was smiling when she and others saw him.