Police said it happened after they received a report around 6:30 a.m. Saturday that a man was yelling and smashing glass on Liberty Street.
The Office of the Inspector General has identified Detective Karli Travis as the officer. Travis runs the Middletown Police Cadet Program and serves in the patrol division.
When Travis arrived, 52-year-old Winston Tate charged at her, holding a hammer, hit her, knocked her to the ground, climbed on top of her and continued to hit her, according to police and the Office of the Inspector General. During the struggle, Travis fired her weapon, police said.
Get top local stories in Connecticut delivered to you every morning. Sign up for NBC Connecticut's News Headlines newsletter.
A witness told police that Travis yelled for Tate to drop the weapon, but he didn't, and hit her in the shoulder with it, which caused her to fall, according to the arrest warrant application.
Tate jumped on Travis, continuing to hit her with the hammer, and Travis yelled for him to drop the weapon before firing her weapon, the witness told police.
He said he heard around seven to nine shots, then started running toward Tate and Travis and distracted Tate long enough for the detective to get away and across the street, according to court documents.
Local
After Tate was wounded, he went back into the house, more officers arrived and he was taken into custody after coming out of the basement hatchway, according to the office of the inspector general.
Tate was brought to an area hospital to be treated for gunshot wounds and he was released Monday. The police department said he is a known convicted felon dating back to 1995.
He has been charged with criminal attempt to commit assault in the first degree, assault in the second degree, assault on public safety personnel and interfering with police, according to police.
His bond has been set at $500,000 and it was increased to $850,000. No plea was entered during a court appearance on Tuesday. Tate is due in court on Oct. 3.
Travis was treated at a local hospital for injuries, including a gunshot wound to the left hand, and has been released.
Police Chief Erik Costa said Travis is at home resting, and the police department is wishing her a speedy recovery. The police chief called the officer's actions an "extreme act of heroism."
During a news conference Tuesday, Mayor Ben Florsheim said video of the altercation is "evidence of an officer taking lifesaving steps for her own sake and the community's sake."
He described the incident as a tragic incident made far better than it could have been.
The Office of the Inspector General is leading the investigation in collaboration with Connecticut State Police, the Eastern District Major Crime Squad and the Middlesex County State's Attorney. The investigation remains ongoing.
Sign up for our Breaking newsletter to get the most urgent news stories in your inbox.