DENVER—The gunman who killed a Colorado sheriff’s deputy escaped from the mental health ward of a Veterans Health Administration hospital in Wyoming in 2014 but was located and returned, according to a Veterans Affairs document obtained by The Associated Press Tuesday.

The document was provided to the AP by a congressional aide on condition of anonymity because the aide was not authorized to release it. The document was first reported by the Denver Post.

The gunman, Matthew Riehl, fatally shot Douglas County Deputy Zackari Parrish and wounded four other officers on Sunday, Colorado authorities said. Riehl was killed by a SWAT team.

The VA document said Riehl was hospitalized at the veterans medical centre in Sheridan, Wyo., in April 2014 after a psychotic episode. The document said he escaped but was found and brought back.

Read more:

Colorado shooter who killed deputy had posted videos criticizing professors, police

1 deputy killed, 4 officers injured in Colorado shooting as police respond to disturbance

The VA issued a statement saying it “cannot ordinarily discuss the specific care of any veteran without a privacy release.” A spokesperson for the Sheridan VA hospital did not respond to an after-hours phone message and email.

In addition to Riehl’s hospitalization in Sheridan, the VA document said he had an “urgent contact for mental health” with another VA facility in July 2015. It did not describe the nature of the contact or say where that facility was, but it was in the department’s Eastern Colorado Health Care System, which includes a hospital in Denver and nine clinics in other cities.

The document said Riehl was on multiple medications in 2015 stemming from an earlier hospitalization, but it did not say what those medications were or why they had been prescribed.

The document identified Riehl as an Army veteran who was honourably discharged. It said his records did not list any military service-related psychiatric disorders.

Colorado authorities said Riehl served in Iraq.

Officials said Riehl, 37, was armed with a rifle and ambushed the officers at his apartment in Highlands Ranch, 28 kilometres south of Denver.

Four deputies, including Parrish, were shot in the initial gunfire. A police officer was wounded later.

The wounded officers managed to get away but had to leave Parrish behind because of their injuries and the ongoing gunfire. Two people in nearby apartment units were also wounded.

The SWAT team arrived about 1 ½ hours after the confrontation began, and Riehl was killed in a gunfight. Authorities said Riehl fired more than 100 rounds during the prolonged standoff.

Before the shooting, Riehl made videos showing himself calling 911 and then opening his apartment door and talking to responding officers.

The footage, livestreamed on Periscope, was obtained by Denver’s KUSA-TV. The station broadcast clips from two videos in which Riehl says he would not hurt anyone except to defend himself before calling authorities.

“Maybe I bought over 1,000 rounds of ammunition from Walmart. It’s not illegal,” he says.

When authorities arrive at Riehl’s suburban Denver apartment, the footage shows him talking to at least two officers, telling them he wants to file an emergency restraining order against his domestic partner. He is upset when one officer offers to give him a phone number to call, and leaves the doorway to go back into a room.

Loading... Loading... Loading... Loading... Loading... Loading...

At another point, Riehl is seen holding a glass in his hand and says he’s had two scotches. He is heard saying that drinking would help him defend himself if someone bothers him.

The TV station said Douglas County Sheriff Tony Spurlock verified the authenticity of the videos and said the 911 call made by Riehl was the second one from his apartment in Highlands Ranch on Sunday.

The first 911 call was made by Riehl’s roommate, who told authorities Riehl was acting strangely and might be having a mental breakdown. Responding deputies to that call found no evidence of a crime and left.

The footage shows the shooting but the station did not air that footage. A clip purporting to show it has been posted elsewhere online.

Riehl, an attorney, previously posted videos criticizing Colorado law enforcement officers in profane, highly personal terms.

Riehl attended the Wyoming College of Law in Laramie. Law college students had been warned about Riehl because he criticized law professors in social media posts.

A Nov. 6 email from Lindsay Hoyt, the assistant dean of the law college, told students to notify campus police if they spotted Riehl or his car near campus, according to KTWO-AM in Casper, Wyo. In addition, security on campus was increased for several days.

Campus officers called police in Lone Tree, Colo., in mid-November to warn them about Riehl, suggesting his rants were indicative of mental illness, UW police Chief Mike Samp told the Denver Post.

Samp said it’s possible that Colorado authorities faced the same issue as Wyoming officials when an apparently mentally ill, dangerous person makes indirect threats.

Riehl was licensed as a lawyer for five years in Wyoming and voluntarily gave up his license in 2016, said Wyoming Bar Association executive director Sharon Wilkinson.

He practised at a law firm in the small city of Rawlins and later opened his own practice but withdrew from the bar in October 2016, making him ineligible to practice law in the state, Wilkinson said. That’s the same year records indicate he moved back to Colorado.

Wilkinson says the bar received no complaints about Riehl.