The man who was identified as the perpetrator of Sunday's mass shooting at a church in Texas died of a self-inflicted wound, Wilson County Sheriff Joe Tackitt confirmed Monday. Authorities believe 26-year-old Devin Patrick Kelley shot himself inside his vehicle, Tackitt said.

Kelley was allegedly responsible for killing at least 26 people and injuring another 20 after he opened fire on the First Baptist Church in rural Sutherland Springs. Initial reports suggested police had killed the man, but the information was later amended by authorities.

Kelley was also shot at by at least one nearby armed neighbor who engaged him as he fled the church in his vehicle. Johnnie Langendorff, who was driving by the church, pursed Kelley with the unidentified neighbor. Kelley left the scene in a car which eventually crashed, The New York Times reported. Police arrived at the scene a few minutes later and found Kelley dead inside the vehicle. He was wearing all black tactical gear, including a bullet-proof vest, and appeared to have used a military-style rifle and a pistol in the shooting.

Police stand outside the site of a shooting at the First Baptist Church of Sutherland Springs, Texas, U.S. November 6, 2017. Rick Wilking/REUTERS

The victims of the massacre range from ages 5 to 72. Among the dead were several children, a pregnant woman and the pastor’s 14-year-old daughter. The town has a small population, and authorities estimated that the shooting killed somewhere between four and seven percent of all of Sutherland Springs.

Kelley was from New Braunfels, Texas, and served in the United States Air Force in New Mexico. He was apparently court-martialed in 2012 on charges of assaulting his wife and child and was discharged in 2014 for “bad conduct” after a year-long confinement for the assault conviction.

“It’s something we all say does not happen in small communities, although we found out today it does,” Tackitt told the Times Sunday.

The motive for the killing spree had not yet been determined. It was the deadliest mass shooting in the state’s history.