The man identified as the shooter who opened fire on a Texas church, killing 26, was discharged from the U.S. Air Force for bad conduct, officials told the Associated Press.

Devin Patrick Kelley, 26, was dishonorably discharged in 2014 for bad conduct after serving four years in logistics readiness at Holloman Air Force Base in New Mexico, an Air Force spokeswoman said. In 2012, he was court-martialed on one count of assault on his spouse and another count of assault on their child, the spokeswoman said. He received a bad conduct discharge, reduction in rank and 12 months confinement, she said.

Kelley is the man identified by officials to The Associated Press as the gunman.

On Sunday night, several law enforcement officers were posted outside Kelley's listed address in Comal County. Neighbors said they have heard repeated gunfire from the property in recent weeks.

Kelley was found dead Sunday, officials said. An armed resident confronted the gunman outside the church, after which he fled and was later found shot in his car, authorities said. State troopers said at a news conference they did not know whether Kelley died from a self-inflicted gunshot wound or was shot by the armed resident.

– The Associated Press contributed to this report.