The gunman who Sunday killed a Douglas County sheriff’s deputy had escaped from a veterans mental health ward in 2014 during a multiweek stay for a psychotic episode, according to new report provided to Congress by the U.S. Department of Veterans Affairs.

The one-page document, obtained by The Denver Post on Tuesday, does not detail the nature of the psychotic episode or how Matthew Riehl escaped from the veterans facility in Wyoming and was apprehended.

But it does show a pattern of mental illness that began to plague Riehl, an Iraq war veteran and lawyer, as recently as April 2014. That month he was hospitalized at a VA facility in Sheridan, Wyo., and admitted to another veterans center in Rawlins.

“Office of Security and Law Enforcement reports that during the inpatient stay in April 2014, the Veteran escaped/eloped from the Mental Health Ward, was located and brought back, and placed on a 72 hour mental health hold,” noted the report. It was not immediately clear from which VA facility Riehl escaped.

After that episode, Riehl had an “urgent contact for Mental Health” on July 22, 2015, and another “mental health assessment” on Aug. 26, 2015.

He skipped a Nov. 3, 2015, appointment and was called in August 2016 to “reschedule an internal medicine clinic” — but he declined, according to the report.

Riehl graduated with a law degree from the University of Wyoming in 2010 and joined a law firm. He opened his own practice four years later, but by October 2016, he had withdrawn his membership in the Wyoming State Bar.

Authorities say Riehl, 37, opened fire on a group of Douglas County sheriff’s deputies responding to a report of a disturbance early Sunday at his Highlands Ranch apartment complex. Deputy Zackari Parrish was killed. Riehl also died in the encounter.

Riehl wounded Douglas County sheriff’s Deputies Mike Doyle, 28, Taylor Davis, 30, and Jeff Pelle, 32, and Castle Rock police Officer Tom O’Donnell, 41. Two residents in adjacent apartments also were wounded.

Riehl used social media to livestream the confrontation leading up to the shooting. Riehl filmed himself calling 911 early Sunday and telling a dispatcher that he was the victim of domestic violence, according to a Periscope recording.

When two deputies arrived and explained why they were there at 3 a.m., Riehl yelled through the door: “I’m coming out! I don’t have any guns on me. I’ll be a minute. Just give me a second,” according to the video posted on Periscope. Riehl opened the door and spoke with the deputies briefly.

“I just feel you are very upset,” one of the deputies told Riehl.

“Yeah, I am. I was assaulted, and you didn’t help me,” Riehl replied and added that the assault happened that night. Riehl added that it’s possible to be assaulted without physical contact.

When the deputy told him he needed to file a civil complaint, Riehl replied that he already said he wanted to file a civil complaint. He added: “They lied.”

Douglas County authorities said deputies left the apartment after concluding that no crime had been committed. They returned on another call shortly after 5:30 a.m., Riehl’s roommate met them outside and gave them a key. At some point shortly afterward, Riehl retreated to his bedroom.

He began yelling at the deputies to “Go away!”

According to the Periscope recording, Riehl can be heard warning deputies: “Go away! Go away! Don’t come in. I warn you!”

He then yells, “Identify! What’s your name?”

Almost immediately a fusillade of gunshots could then be heard on the recording. He eventually would fire more than 100 shots at officers from a rifle. A smoke alarm can be heard beeping. On the Periscope recording, Riehl said he had obtained 1,000 rounds of ammunition from Walmart.

“What? Get the (expletive) out of here. … Get out! Leave me alone! Why are you here? You don’t have a warrant. Go away! Leave me alone!. Go! Get out!” an increasingly frantic Riehl shouts before firing another round of shots.

“They broke my door! They broke my door! They broke my door! They broke my door! They broke my door in! Oh, my God. Why? Why? Why?” Riehl shouts. “Leave me alone!”

Riehl continued to shout: “I said go away! I pay rent! I want civil! Get me civil! Look what they did to my door!”

Riehl then shouts, “Somebody’s dead out there. …You broke in, you’re dead. … I told you, where’s your warrant? Where’s your warrant?”

Several people saw the video as it was livestreamed and called the sheriff’s office. The video was taken off the Periscope website.

Denver7 on Tuesday obtained a report from University of Wyoming police showing Riehl’s behavior in the months leading up to Sunday’s shooting had become a concern for friends and family.

According to the television station, the report shows the suspect’s brother told investigators that Riehl was diagnosed with bipolar disorder and recently suffered a “manic breakdown,” refusing all contact with family.

Also in the university police report, obtained by Denver7:

• His mother said he was working at a Walmart in Highlands Ranch last she knew.

• A supervisor at Walmart told investigators that Riehl walked off the job and filed an unsubstantiated complaint against the store.

• His mother said Riehl would use his law degree to intimidate people and often threaten lawsuits, although he never made violent threats.

• Riehl had filed a false report with Lone Tree police stating that his mother and brother were in a suicide pact.

• Friends were concerned when they reached out to in November to Riehl, who texted back gibberish.

• University of Wyoming police had documented issues with Riehl dating to 2008. A dean at the law school also said he was a problem while he was a student there.

Wyoming authorities had warned Lone Tree police about Riehl after he made a series of veiled threats against professors at the UW law school. (Riehl had also posted anti-police rants online before the shooting.)

Riehl’s mother told authorities that her son had post-traumatic stress disorder from his Iraq war deployment and was refusing to take his medication to treat the condition.

Riehl enlisted in the Army Reserves in 2003, and in 2006 he joined the Wyoming Army National Guard. He deployed as part of Operation Iraqi Freedom from April 2009 to March 2010. He was honorably discharged in 2012.

His last rank was specialist, and he was classified as a medic.

Deidre Forster, a spokeswoman for the Wyoming Army National Guard, said she wasn’t aware of any discipline leveled against him or any issues surrounding his service. She also said she didn’t know whether he saw any combat.

“I’m not aware that he did,” Forster said. “I don’t believe he did.”

Forster said he served during Operation Iraqi Freedom with the 2nd Battalion of the 300th Field Artillery.

“I don’t have the name of the base where he was stationed, but I believe it was in Kuwait,” she said.

On Tuesday, the Douglas County Sheriff’s Office announced that funeral services for Parrish have been set for 11 a.m. Friday at Cherry Hills Community Church.