After eluding capture for more than three weeks, fugitive Kaunda Magee lost a shootout with a Louisiana state trooper Wednesday afternoon, authorities said.

Magee ended up wounded and under arrest in a McComb, Miss., hospital with nonlife-threatening injuries, according to Louisiana State Police.

It was Magee’s second shootout in two days and the third time he fired on law enforcement officers since a home invasion case earlier this month in Pine, authorities said.

The search for Magee, which moved from Tangipahoa Parish to Mississippi on Tuesday, ended in gunfire at a travel trailer in Pike County, Miss., said Nick Manale of Louisiana State Police at Troop L in Covington.

Louisiana state troopers were checking residences in the area where Magee was believed to be hiding when a property owner asked a trooper to assist him in checking a travel trailer on his property, Lt. Doug Cain said.

As they approached the trailer, Magee, who was hiding inside, fired on the trooper, but missed, Cain said.

The trooper returned fire and wounded Magee, Cain said.

Magee then jumped from the trailer, where he was confronted by the resident armed with a shotgun, said Jon Kalahar, of the Mississippi Bureau of Investigation, which is handling the investigation of the shooting.

Kalahar said the Mississippi Bureau of Investigation had a crime scene unit en route to the site late Wednesday.

Authorities have not named the trooper or the property owner involved in Magee’s capture.

Wednesday’s gunfight occurred behind a residence on Osyka Progress Road, said Dawn Panepinto, of the Tangipahoa Parish Sheriff’s Office, which continued to participate in the case after Magee allegedly stole a car and fled Tangipahoa Parish on Tuesday morning.

Less than 20 minutes after the Tuesday morning car theft, pursuing Tangipahoa deputies found Magee near Progress, Miss., where they exchanged gunfire with him before he disappeared into the woods.

Authorities mounted yet another manhunt with dogs and helicopters, as they had done in Tangipahoa Parish, where Magee had hidden in a large wooded area for almost two weeks.

While there, Magee allegedly committed burglaries to supply himself with food and clothing.

Magee had been evading authorities since Oct. 3, when he allegedly broke into a Washington Parish home and subsequently shot at deputies and State Police during a car chase, according to State Police.

He resurfaced two weeks later in Tangipahoa Parish, where he fled into the woods after Washington Parish sheriff’s deputies attempted to apprehend him in connection with the Oct. 3 incident.

Magee, 36, had been sought on warrants for aggravated rape, kidnapping, criminal damage to property and four counts of attempted murder of police officers in connection with the Oct. 3 home invasion in Washington Parish and the subsequent chase, authorities have reported.

Panepinto said Wednesday that additional criminal counts were pending against Magee in connection with his activities since Oct. 3.