The gunman who killed 26 people in a Texas church this weekend had escaped from a behavioral health center in New Mexico in 2012 and allegedly made threats against his U.S. Air Force commanders, records state.

This undated photo provided by the Texas Department of Public Safety shows Devin Kelley, the suspect in the shooting at the First Baptist Church in Sutherland Springs, Texas, on Nov. 5, 2017. A short time after the shooting, Kelley was found dead in his vehicle.

On June 13, 2012, El Paso police received a call telling them that Devin Kelley, 26, had escaped from the Peak Behavioral Health Services, 5045 McNutt Road in Santa Teresa, N.M., according to an El Paso Police Department incident investigation report. The caller stated Kelley suffered from mental illness and was a danger to himself.

The caller told police that Kelley was at the Greyhound Bus Station at 200 W. San Antonio Ave. in Downtown El Paso, the report states.

Kelley had allegedly been caught trying to sneak firearms onto Holloman Air Force Base in Alamogordo, according to the report.

Kelley was also allegedly attempting to “carry out death threats” that he had made against his “military chain of command,” the report states.

Kelley worked as a logistics readiness specialist at Holloman Air Force Base from 2010 until his discharge in 2014, when he was convicted on domestic violence charges.

More: Harrowing moments inside Texas church: Gunman shouted 'everybody die,' fired at crying children

More: The man who took down the Texas church gunman

The report states that Kelley came to the El Paso bus station with the intent to take a bus out of state.

Kelley did not resist orders from El Paso police officers nor did he make any comments about harming himself or others, the report states.

The report states that officers submitted it for “informational purposes,” and Kelley’s information was never entered into the department’s missing or endangered person’s database.

El Paso police then turned Kelley over to Sunland Park Police Department officers since the behavioral center was in their jurisdiction, the report states.

Sunland Park Police Department Lt. Eric Lopez on Tuesday told the El Paso Times that the department is currently searching for any documents related to Kelley. He added that the department changed its electronic filing system recently and that officials are searching through the old database.

Lopez said there is no guarantee that any reports about the incident were filed with the Sunland Park Police Department since Kelley reportedly did not commit any crimes while he was out of the behavioral center.

Peak Behavioral Health Services is a psychiatric residential treatment facility which specializes in treating patients suffering from mental health and chemical dependency needs, according to its website.

Kelley’s detainment by El Paso police came months after he allegedly assaulted his wife and a 2-year-old boy who Air Force officials identified as his stepson.

Kelley allegedly choked the woman, pulled her hair and kicked her during separate incidents from June 24, 2011, to April 27, 2012, according to court documents.

During this same time period, he also allegedly hit the boy on the head and body “with a force likely to produce death or grievous bodily harm,” documents state.

Kelley was accused of striking the boy on the head so hard it fractured his skull, documents state.

The names of the victims were blacked out of the court martial documents released by U.S. Air Force officials on Monday.

Kelley was married to Tessa Kaylynn Kelley at the time of the incident, according to court records. The couple was married in April 2011 and got divorced in 2012.

Tessa Kaylynn Kelley, whose maiden name is Loge, was born in El Paso in 1992, according to El Paso County birth records.

Devin Kelley was found guilty during a court martial on the two counts of domestic assault.

Devin Kelley was sentenced to one year confinement at Naval Consolidated Brig Miramar in California on the domestic violence convictions, U.S. Air Force officials said on Monday.

He was then released with a bad conduct discharge and reduction in grade to E-1, the lowest enlisted rank in the Air Force.

Devin Kelley fatally shot 26 people and wounded another 20 on Sunday at the First Baptist Church of Sutherland Springs, Texas, outside of San Antonio.

Kelley died a short distance from the church due to a self-inflicted gunshot wound.

Follow Aaron Martinez on Twitter @AMartinez31.