PERRYVILLE, Ark. (AP) — A man being booked into a central Arkansas jail on drug charges pulled out a gun and fatally shot a guard before someone disarmed him, authorities said Thursday.

Jeremiah Story, a 21-year-old detention officer at the Perry County jail in Perryville, about 35 miles (56 kilometers) northwest of Little Rock, died at a hospital early Thursday, the State Police said in a news release.

Roderick Lewis, 37, shot Story in a bathroom late Wednesday night while Lewis was changing out of civilian clothes and into jail issued attire, said the State Police, which was asked to investigate by the county sheriff’s office. A State Police spokesman said Lewis used a gun he had with him when he entered the jail. Lewis was charged with capital murder Thursday afternoon in Story’s death.

It was not clear Thursday afternoon if Lewis has an attorney representing him.

Lewis, of North Little Rock, was arrested earlier Wednesday evening and was being detained on drug and drug paraphernalia charges.

A witness to the shooting was able to disarm Lewis, who was later transferred to the Faulkner County Detention Center in Conway, police said.