An armed suspect was taken into custody after fleeing a gunfight with police in which his father, wanted on felony warrants, was killed and a Fort Worth officer was critically wounded, police said.

Authorities arrested Ed McIver Jr. on Tuesday evening, four hours after officer Matthew Pierce was wounded during a foot chase with the 20-year-old suspect and his father 42-year-old Ed McIver Sr. The father was killed, Fort Worth Police Department said in a statement.

Pierce, who has been with the Fort Worth Police Department since 2009, underwent surgery for multiple gunshot wounds at an area hospital, a police spokeswoman said. Police said Pierce was in critical condition.

The pair fled when authorities pulled them over in an SUV they were traveling in at about 2:30 p.m. local time to arrest McIver Sr., who was wanted on felonies warrants for aggravated assault with a deadly weapon and aggravated assault family violence charges, police said in a statement.

The two ran into a wooded area along Interstate 30 in west Fort Worth and exchanged gunfire with police. The elder McIver was shot and killed, police said.

Authorities captured McIver Jr. at about 6:30 p.m. local time after an extensive search. He was armed with a rifle. McIver Jr. was being held on criminal attempt capital murder, evading arrest and unlawful carrying of a weapon charges, police said.