The suspect who opened fire inside a South Texas church has been identified as 26-year-old Devin Patrick Kelley, officials say.

On Sunday, authorities initially identified the suspect as a young white male. They said he was dressed in all black and tactical gear when he opened fire with an assault rifle at the First Baptist Church in Sutherland Springs, about 35 miles southeast of San Antonio. The shooting left at least 26 people dead and 20 others injured in what Texas Gov. Greg Abbott described as the worst mass shooting in his state's history.

As the gunman left the church, an unidentified area resident confronted him with his own rifle and shot the suspect, officials said. Kelley fled in his vehicle, and the resident flagged down a driver and they pursued him. The driver described chasing down the suspect until he crashed his car.

Get Breaking News Delivered to Your Inbox

When police arrived, the shooter was found dead, apparently from a self-inflicted gunshot wound, Wilson County Sheriff Joe Tackitt told CBS News correspondent Jeff Glor in an interview Monday morning. Officials said Monday Kelley called his father before killing himself and told him he had been shot and didn't think he was going to make it.

"Domestic situation" before shooting

Officials Monday wouldn't describe a motive but said there had been a "domestic situation" between the shooter and his mother-in-law before the massacre in which the suspect had sent the woman threatening texts.

"We know that he expressed anger towards his mother-in-law who was in this church," Texas Department of Public Safety regional director Freeman Martin said.

Martin wouldn't detail the texts but said the shooting wasn't related to race or religion. Officials have previously said Kelley had no apparent links to terrorist groups.

Kelley has a residence in New Braunfels, Texas, which is about a 35-mile drive from where the attack took place in Sutherland Springs. CBS affiliate KENS-TV reports he graduated in 2009 from New Braunfels High School. Public records cited by the San Antonio Express-News show Kelley, then 20, married in 2011 and was divorced the next year.

Devin Patrick Kelley

In 2014, Kelley, then 23, married again, the paper reports. The sheriff confirmed that Kelley's former in-laws and ex-wife attended the First Baptist Church from time to time, although they were not present during the attack.

A law enforcement source told CBS News senior investigative producer Pat Milton that Kelley did some work as a bible teacher, but it's not known what church he worked at or whether he worked at the Sutherland Springs church.

Investigators will look at his social media posts made in the days prior to Sunday's attack -- including one that appeared to display an AR-15 semiautomatic weapon.

Officials say Kelley did not have a license to carry firearms. He purchased four weapons in total, in 2014, 2015, 2016, and 2017 --two were bought in Colorado, and two in Texas, ATF officials said. Three weapons were recovered at the scene -- a Ruger AR-556 rifle found at the church, and two handguns, a Glock 9mm and a Ruger 22, found in his car, according to Fred Milanowski, special agent in charge of the ATF Houston.

A law enforcement source tells CBS News Justice and Homeland Security correspondent Jeff Pegues that Kelley purchased the Ruger AR-556 from an Academy Sports and Outdoors location in San Antonio in April 2016, and one of the handguns, the Glock 9mm, at Specialty Sports in Colorado Springs in December 2014. Academy Sports confirmed in a statement to CBS News that Kelley also purchased another firearm from the store in 2017.

"We also confirmed that both sales were approved by the National Instant Criminal Background Check System (NICS). We are cooperating with law enforcement as they investigate further," the store said.

CBS News' David Martin confirms that the U.S. Air Force failed to submit the shooter's criminal history to FBI, as required by Pentagon rules. That history should have barred him from purchasing guns. The Air Force said it has launched a review of how the service handled Kelley's criminal records.

Martin said Kelley was seen before the shooting at a Valero gas station across the street from the church, and was "obviously suspicious to others" because he was wearing a black mask with a skull on it. He was wearing all black and a ballistic vest with a plate on the front, Martin said.

Former U.S. Air Force member, court-martialed in 2012

Kelley is a former U.S. Air Force member who served from 2010 to 2014. Records confirm Kelley previously served in logistics readiness at Holloman Air Force Base in New Mexico until his discharge in 2014, Air Force spokesperson Ann Stefanek said in a statement. Kelley, who received several service awards during his time with the Air Force, was responsible for moving passengers, cargo and personal property in military transportation.

Kelley was court-martialed in 2012 for two counts of assault on his then-wife and assault on her child, Stefanek said. Col. Don Christensen, a retired Air Force chief prosecutor who office prosecuted Kelley, told CBS News there were multiple instances in 2011 and 2012 in which Kelley assaulted his then-wife and her son, who was his stepson. Kelley physically assaulted the boy, pushed him down, shook him and fractured his skull, causing a severe hematoma, Christensen said.

Kelley pleaded guilty to "diverse occasions" of assaulting son and wife, Christensen said. He received a bad conduct discharge, and reduction in rank and confinement for 12 months.

His wife, Tessa Kelley, filed for divorce the same year as the court-martial. In paperwork associated with the divorce, Tessa Kelley said she was working at Taco Bell for $7.50 an hour while Devin Kelley was in detention. The divorce was finalized in October 2012.

The Air Force tells CBS News Kelley's case was a general court martial, the most serious level of military trial proceedings. It is reserved for more serious criminal allegations, those substantially similar to felonies in civilian jurisdictions.

While personnel tried under general court martial can be subject to dishonorable discharge, Kelley received the less severe bad conduct discharge. Federal law prohibits those who have been dishonorably discharged from buying a firearm, but the law does not include a blanket prohibition on those who have received a bad conduct discharge. However, certain types of bad conduct discharges can stem from cases that would bar defendants from purchasing firearms.

Texas and federal laws prohibit those with domestic violence convictions from owning firearm. The military is supposed to report to the FBI, for the purposes of prohibiting firearm purchases, convictions on domestic violence charges, as well as convictions that carry maximum potential sentences of more than a year in confinement. It is unclear if the FBI was notified about Kelley's case, which fit both conditions.

Reportedly terminated from security guard position

The San Antonio Express-News reports Kelley had previously worked as a security guard at Schlitterbahn, a New Braunfels water park and resort, a job that required him to pass a criminal background check. A spokeswoman for the park told the paper Kelley spent five and a half weeks working as a nighttime security guard there beginning in June.

He was reportedly terminated from his position.

The spokeswoman, Winter Prosapio, said Kelley was unarmed during his brief employment and his duties included checking gate locks at night. Prosapio did not say why he was terminated.

Kelley had a security guard license issued by the Texas Department of Public Safety, reports the Express-News. Martin confirmed Kelley had a "non-commissioned, unarmed, private security license similar to a security guard at a concert type situation."

Martin said Kelley had "no disqualifiers" to enter into the National Crime Information Center Database that would preclude him from receiving a private security license. He said private security background checks include fingerprints and criminal history checks with Texas Crime Info Center and national databases, and Kelley was cleared.

Kelley later worked at Summit Vacation and RV Resort in New Braunfels. Manager Claudia Varjabedian told CBS News national correspondent Omar Villafranca that Kelley showed up for work as an overnight security guard Saturday, but left early, leaving behind a note that said he wasn't feeling well and had a headache. Varjabedian said Kelley did not show up for work on Sunday. She said she intended to fire him.

She said she didn't get to know Kelley well, but said she never received any complaints about him.

"No signs of anything, quite polite young man, and that was about it," Varjabedian told Villafranca.

Allegations of domestic abuse, animal cruelty

Law enforcement went to Kelley's New Bruanfels home three years ago to investigate a domestic violence complaint involving him and his then-girlfriend.

Paul Anthony, a spokesman for the Comal County district attorney's office, told The Associated Press that sheriff's deputies were called just after 10 p.m. on Feb. 1, 2014.

Citing a sheriff's office report, Anthony says a friend of Kelley's girlfriend told authorities she received a text message from the girlfriend that indicated "her boyfriend was abusing her." When sheriff's deputies arrived at the home, they were told by people in the house that there was no problem.

No arrests were made. Kelley married the girlfriend, Danielle Shields, two months later.

Kelley moved to Colorado later in 2014, registering to vote with an address traced to the Colorado Springs area, home to the U.S. Air Force Academy and other Air Force installations

Court records in El Paso County indicate Kelley was cited on Aug. 1, 2014 at the mobile home where he lived. The Denver Post reports the citation was for misdemeanor animal cruelty.

An El Paso County deputy report obtained by the paper says a woman saw Kelley punch a dog four to five times near its head and neck, and then grab the dog by the neck and drag it away. Another witness said he saw Kelley pick the dog up into the air and throw it to the ground.

A sheriff's sergeant who responded to Kelley's mobile home said he found the dog undernourished. Authorities reportedly took the animal to the veterinary specialty center.

Kelley reportedly said he jumped on the dog to keep it from acting aggressively toward another animal but denied hitting the dog, throwing it to the ground or carrying it by its neck.

He was given a deferred probationary sentence and was ordered to pay $368 in restitution. The cruelty to animals charge was dismissed in March 2016 after Kelley completed his sentence.

The Denver Post reports court records indicate someone was granted a protection order against Kelley on Jan. 15, 2015, also in El Paso County.

Acquaintances describe gunman as unstable

Former classmates at New Bruanfels High School described Kelley to KENS-TV as disturbed, judgmental, unfriendly, and unstable. They said his most recent social media posts were dark and indicated he was going through relationship problems and possibly a break-up.

At the address listed for Kelley in New Braunfels on Sunday, two sheriff's vans were parked outside and police officers stood at the gate of a cattle fence surrounding the property. Law enforcement officials gathered at the property declined to comment on why they were there. Several messages left for his relatives went unreturned.

Neighbors said that they heard intense gunfire coming from the direction of the address listed for Kelley in recent days.

"It's really loud. At first I thought someone was blasting," said Ryan Albers, 16, who lives across the road. "It had to be coming from somewhere pretty close. It was definitely not just a shotgun or someone hunting. It was someone using automatic weapon fire."

Kelley also ran a billing software company called Dilloware Inc. at his Comal County residence, according to the San Antonio Express-News. Local records show Kelley was ticketed in August in New Braunfels for an expired registration and not having auto insurance.