HAYNEVILLE, Ala. — An Alabama sheriff was fatally shot Saturday evening in a community near the state’s capital, authorities announced, and an 18-year-old suspect was taken into custody after an hourslong manhunt.

Gov. Kay Ivey tweeted that Lowndes County Sheriff John Williams had been “tragically killed” in the line of duty and that she offered her prayers and sympathy to his family and the Lowndes County Sheriff’s Department. The suspect was identified as 18-year-old William Chase Johnson.

Montgomery County Sheriff Derrick Cunningham initially told news outlets that Williams was shot at a gas station.

The state had issued an emergency alert saying it was seeking an 18-year-old white man last seen at a QV gas station at 8:15 p.m., in the area and around the time of the reported shooting. Sgt. Steve Jarrett, the commander of state troopers’ Montgomery post, later confirmed to reporters that the shooting took place at the QV station, and that Johnson was the only suspect at the time. He was considered a “serious risk” who may have been traveling on foot, according to the alert.

Jarrett confirmed to news outlets that Johnson approached the shooting scene just after midnight, and had a handgun with him. The state law enforcement agency canceled the emergency alert early Sunday, saying Johnson was in custody.

“Details as to how he fled the scene and then reappeared at the scene, all that’s going to be investigated,” Jarrett said, according to WSFA-TV. The gas station is located in the Lowndes County seat of Hayneville, around 20 miles (32 kilometers) southwest of Montgomery.

The tall sheriff was known as “Big John.” Ivey paid tribute to him online, writing that in his years of service in the U.S. Marine Corps and “his many years working in law enforcement, he dedicated his life to keeping other people safe.”

The sheriff was first elected in 2010, running as a Democrat. He was a Lowndes County native who started volunteering as a reserve deputy in 1978. He also worked for Hayneville police before joining the sheriff’s department full-time in 1987 and being appointed chief deputy in 1990.

“Sheriff Williams always wanted to make a difference in his community and felt there was no better way to help his community than to protect and serve them in law enforcement,” the biography read.

Lowndes County is predominantly black. It had a population of around 11,000 in the 2010 census. In 2007, more than 60 people gathered at the Lowndes County Courthouse to protest then-Gov. Bob Riley’s appointment of a white law enforcement officer to replace the county’s deceased sheriff. At the time, the county commission president said all five commissioners and other elected officials had recommended Williams, who is black, for the position.

During his decadeslong career with the sheriff’s office, Williams notably in 2000 was the arresting officer of Jamil Abdullah Al-Amin, a 1960s black militant who was known as H. Rap Brown before converting to Islam. Al-Amin was wanted and later convicted in the fatal 2000 shooting of a Fulton County sheriff’s deputy in Atlanta.

Williams is the fifth Alabama law enforcement officer to die from gunfire in the line of duty, and the sixth overall, in 2019, according to a statement from state Attorney General Steve Marshall.