A gunman is in custody after allegedly shooting two law enforcement officials in southern Missouri in what authorities have described as an ambush.

A sheriff’s deputy and Missouri state trooper were serving an eviction notice in the town of Van Buren on Friday, Aug. 19, when the armed resident opened fire.

“Officers from the Missouri State Highway Patrol were assisting the Carter County Sheriff’s Department at a residence in rural Carter County near Van Buren, Missouri,” MSHP officials wrote in a statement. “After attempting to contact the occupant, a male suspect began firing from inside the residence.”

Officials cited by KCTV News said bullets struck the deputy in the leg, groin, and chest, while the trooper was shot in the shoulder area and a round hit his bulletproof vest.

The gunman then barricaded himself in the home and engaged law enforcement in an hours-long standoff, which ended when the suspect surrendered.

The Missouri State Highway Patrol announced on Friday evening that the alleged shooter had been taken into custody.

“The suspect in the Carter County officer-involved shooting has exited the residence and surrendered to a Highway Patrol SWAT team,” the MSHP wrote on Twitter.

Both officers were transported to a local hospital where they were being treated for their injuries. Patrol spokesman Sgt. Clark Parrott told KCTV that both men were wearing bulletproof vests at the time of the attack.

Corporal Dallas Thompson of the highway patrol told ABC News that the deputy remained in hospital in stable condition while the trooper was treated and released.

Missouri Gov. Mike Parson described the attack as an “ambush” on local law enforcement.

“A @MSHPTrooperG Trooper & Carter County Sheriff’s Deputy were ambushed by a gunman from inside a residence today. Both officers were wounded & are hospitalized. Missouri officers are devoted to making our state safer despite the risks they face every day,” Parson tweeted Friday afternoon.

Police have not yet released the name of the suspected gunman.

Carter County is located about 150 miles southwest of St. Louis.

–EPTimes and Metro Voice