A Texas police chief is in critical condition after being shot in the head while working security at a bar early Sunday morning, authorities said.

Marlin Police Chief Darrell Allen was working a security job at the Laid Back Lounge II in Temple when he got into an "altercation" with a suspect and was shot while attempting to detain him, according to the Temple Police Department. Allen was "in uniform" but off-duty at the time of the 1:30 a.m. shooting, Temple Police Sgt. Allen Teston told NBC News.

Initially, Allen's head wound was considered "life-threatening," and he was brought to the Baylor Scott and White Hospital in Waco, which is about 40 miles north of Temple. Allen was in critical but stable condition Monday afternoon, according to police.

The suspect in the shooting, 24-year-old Derrick Wayne Gamble, was detained at the Bell County Jail shortly after the shooting, according to police. He was charged with aggravated assault with a deadly weapon, and his bond was set at $750,000 on Monday morning, according to jail records.

Derrick Wayne Gamble, 24. Bell County Jail

Allen has been a law enforcement officer since 1994, and became chief of police in Marlin — a town of about 6,000 people — in 2009, according to his profile on the city's website. "His number one priority is Police Community Relations and Juvenile Safety," the profile said, adding that the Allen was pursuing a degree in criminal justice.

At least a dozen police departments and law enforcement associations across Texas offered thoughts and prayers to Allen and his family.