A suspect in the stabbing of an elderly woman grabbed the gun of a detective who was questioning him and fatally shot the man in a conference room at police headquarters, authorities said.

James Allen, 50, died early Sunday while questioning Esteban Carpio, who was not under arrest and had been taken out of handcuffs.

After the shooting, Carpio broke a third-floor window in an adjacent office and jumped out. He was captured after a struggle a few blocks away and was later charged with murder, police said.

Police Chief Dean Esserman would not say how Carpio managed to get Allen's weapon and would not discuss details of the shooting.

"The investigation has begun and we will find answers, but not here this morning," he said at a news conference.

Esserman also would not discuss the protocols for carrying weapons inside police headquarters or for interviewing suspects.

Carpio, 26, was treated at a hospital for injuries to his leg, arm and head suffered in the fall. The 84-year-old woman who was stabbed was expected to recover.

Allen, a 27-year veteran of the force, was an experienced investigator and one of the department's longest-serving detectives.

"Jimmy Allen passed in the noblest way possible. He gave his life trying to make our lives safer," Mayor David Cicilline said. "He died a hero."

Michael Brady, an expert in police procedures who teaches at Salve Regina University (search) in Newport, said every police station has so called "weapons secure" areas, where guns are banned. These generally include cell blocks and interrogation rooms, he said, but not areas such as detective conference rooms.

If Allen wanted to question Carpio, Brady said, it would not have been unusual for him to do so in a nonsecure area with his gun in his holster.

"This officer was not doing something very different than what police officers throughout the nation do every single day," he said.

Security in government buildings has been a greater concern since March, when a man being tried for rape in Atlanta allegedly overpowered a guard and took her gun, then killed the judge presiding over his case, a court reporter, a deputy outside the courthouse and a federal customs agent.

Weeks earlier, the husband and mother of a Chicago federal judge were slain in the judge's home.