It was a violent few hours for police officers in two states as one in North Carolina was killed during a traffic stop and another in Tennessee was badly wounded while searching for a suspect at an apartment complex.

Trooper Kevin Conner was fatally shot around 12:15 a.m. ET Wednesday in Columbus County when he stopped a pickup truck — driven by 20-year-old Raheem Cole Dashanell Davis — for speeding, according to the North Carolina State Highway Patrol.

Trooper Kevin Conner. North Carolina Department of Public Safety

Conner was approaching the vehicle when Davis opened fire. Conner was rushed to the hospital, where he was pronounced dead.

Sgt. Michael Baker said Davis drove away and led police on a brief chase, then fled on foot when the pickup became disabled at a railroad crossing.

After an extensive search, authorities caught Davis in a wooded area in Fair Bluff and took him into custody around 4 a.m. ET.

Davis was charged Wednesday with first degree murder.

Conner was an 11-year veteran, assigned to Troop B, District 5 in Columbus County. In 2011, he extinguished a car fire while also tending to a driver involved in a head-on collision.

“The Highway Patrol family is mourning the loss of a hero and will forever be changed by the tragic events that have occurred," said Col. Glenn McNeill Jr., commander of the State Highway Patrol.

In Tennessee, a Shelby County deputy was shot in the right leg while searching for a suspect at the Eden at Watersedge Apartments in Memphis between 3 a.m. and 4 a.m. ET.

The department said in a tweet that the deputy was taken to Regional One Health Medical Center in critical condition. The sheriff's department later said his condition had improved and he was listed as noncritical.

The deputy, whose identity has not yet been released, is with the department's Fugitive Division and has been with the department for about 10 years, Sheriff Floyd Bonner said.

The Tennessee Bureau of Investigation said deputies were at the apartment complex to serve a search warrant to 19-year-old Keyshon Parham, who had several active felony warrants.

When deputies entered the residence, Parham reportedly escaped out of another exit leading authorities on a foot pursuit.

At some point, an altercation occurred between three officers and Parham before he was shot. Parham was pronounced dead at the scene.

Two deputies fired shots at Parham, but the deputy who was injured was not one of them.