Updated at 4:45 p.m. ET Monday

A few details are becoming known about the man who allegedly shot and killed at least 26 people and wounded 20 others Sunday at a rural community church in South Texas.

Texas Department of Public Safety Director Freeman Martin says Devin Patrick Kelley, 26, was found dead in a vehicle with two firearms a few miles from where the attack took place. Kelley had crashed his car in a neighboring county after being pursued by two civilians, one of whom had fired on him with his own weapon as Kelley attempted to escape the church.

Authorities believe Kelley shot himself.

As we reported earlier, at about 11:20 a.m. local time Sunday, the gunman, dressed in all-black tactical-type gear, approached the church, located about 40 miles southeast of San Antonio and opened fire with what authorities say was a Ruger AR assault-type rifle. He then entered the church and continued the attack. The victims ranged in age from 18 months to 77 years old.

At a news conference, Martin said the shooter was wearing a bulletproof vest. The San Antonio Express-News says the weapon was an AR-556, a variant of the AR-15, a popular rifle based on the military's M-16.

Kelley was a resident of New Braunfels, a suburb of San Antonio, according to public records and he had attended New Braunfels High School, a classmate confirmed to NPR member station KUT reporter Mose Buchele.

He had been enlisted in the U.S. Air Force and was based in New Mexico from 2010, where he reportedly served in logistics readiness at Holloman Air Force Base until receiving a bad conduct discharge in 2014, Air Force spokeswoman Ann Stefanek tells NPR in an email.

Retired Col. Don Christensen, the Air Force's top prosecutor during this period, tells NPR's Camila Domonoske that Kelley was court-martialed in 2012 for assaulting his then-wife and child.

"He fractured his baby stepson's skull," Christensen says.

Kelley pleaded guilty to to assault on his wife and "intentionally inflicting grievous bodily harm" on his stepson. And as Camila explains, this conviction on a crime of domestic violence punishable by a prison sentence of more than one year should have barred Kelley from possessing a firearm:

"Kelley's punitive discharge — a bad conduct discharge — did not prohibit him from owning a gun, as a dishonorable discharge would have."But under federal law, anyone convicted of 'a crime punishable by imprisonment for a term exceeding one year' is prohibited from possessing a firearm. The same is true for anyone convicted of 'a misdemeanor crime of domestic violence.'"Kelley's conviction qualified under both categories, Christensen says."

Despite this prohibition — and despite the fact that he didn't have a license to carry a firearm — agents with the federal bureau of Alcohol, Tobacco, Firearms and Explosives say Kelley purchased four guns over the span of four years after his discharge.

A Pentagon source tells NPR's Tom Bowman that the Air Force made a mistake in not entering Kelley's arrest or conviction in the federal crime database, the National Instant Criminal Background Check System.

Bowman explains further:

"This was mishandled by the Air Force Office of Special Investigations at Holloman Air Force Base in New Mexico, where Kelley was serving when he was arrested for assaulting his wife and baby stepson. An investigation is now underway, and the Air Force is taking it very seriously, said the source. "The information into the data base is supposed to go in when there's 'probable cause' and then 14 days after a court decision. Kelley was convicted in 2012 and received a year in jail."

Authorities believe Kelley's attack was not motivated by either racial or religious reasons, but rather by a "domestic situation" instead. At a news conference Monday, officials said Kelley had sent threatening text messages to his mother-in-law, a parishioner at the church.

Copyright 2017 NPR. To see more, visit http://www.npr.org/.