An escaped convicted killer was fatally shot in a gun battle with law enforcement on Thursday south of San Antonio, Texas, concluding a three-week manhunt that began when the man fled from a prison transport bus in East Texas.

Gonzalo Lopez, 46, was killed just hours after a Houston-area family of five was discovered dead in a Centerville, Texas, weekend home. Lopez was the “prime suspect” in the killings of one adult and four children, according to authorities.

The children were students in Tomball ISD and were visiting their grandfather at his ranch, according to the district. The victims’ identities have not been released.

Lopez allegedly stole the family’s truck to flee.

CLICK HERE TO GET THE DALLAS EXPRESS APP

The white pickup was spotted near North Star Mall in northern San Antonio, according to Jason Clark, a spokesman for the Texas Department of Criminal Justice. That is when officers began following him.

Police pursued him to Atascosa County, just south of San Antonio. They used spike strips to flatten the truck’s tires, causing Lopez to crash into a tree. The fugitive escaped with an AR-15 rifle and a handgun that he had stolen in Leon County, authorities said.

“He exited his truck,” said Atascosa County Sheriff David Soward. “He fired additional rounds. At least four officers returned fire at the suspect.”

Lopez was killed by the gunfire. No officers were injured.

The Dallas Express previously reported that Lopez was on a bus with 15 other prisoners on May 12 for medical visits in Huntsville. He allegedly slipped out of his shackles and attacked the bus driver, slashing his hand and chest, according to investigators.

Lopez escaped in a rural area of Leon County, about halfway between Houston and Dallas.

After killing a man with a pickax in 2005, Lopez was sentenced to life in prison on a capital murder conviction. He was later convicted of attempted capital murder for trying to kill a police officer and given a second life sentence. Lopez had a long history of violent assault, kidnapping, and drug offense accusations dating back to 1995.