The man who shot two New Hope police officers outside a City Council meeting Monday had undergone years of court-ordered mental health treatment and been released from the state hospital at St. Peter in 2013 after being found incompetent to stand trial, court documents revealed Tuesday.

Authorities have yet to address Raymond Kmetz's motive, which ended with the officers he had wounded fatally shooting him. But the 68-year-old man clashed repeatedly with authorities, in particular in New Hope, over the past few years, according to documents and family members. From 2008 to last summer, he had appeared before the small northwest metro city's council to speak at least four times. In nearby Crystal, police had filed a restraining order against him in August.

New Hope officers Beau Schoenhard and Joshua Eernisse, who were wounded in the exchange of gunfire, were doing well after leaving the hospital Tuesday, according to a Hennepin County Sheriff's Office spokeswoman.

Eernisse, 30, has been employed with New Hope police for a year, and was previously employed as a police officer in Mason City, Iowa. Schoenhard, 36, has been with New Hope since 2008.

Schoenhard and others from his department were just leaving a swearing-in ceremony for Eernisse and another officer Monday night when Kmetz opened fire, authorities say.

Kmetz's son, Nathan Kmetz, said Tuesday that his father may have been driven to despair by the loss of his house and other events.

"He wanted to be heard, and he's been ignored," Nathan Kmetz said. "His family is gone, his assets were gone. He didn't have a dime to his name. He didn't have a place to live. And nobody was doing anything about it."

Starting in 2009, Kmetz had been in and out of St. Peter as part of a court-ordered civil commitment designed to restore his competency so he could stand trial on charges of terroristic threats, property damage and assault, documents show. In July 2013, he was freed after a judge agreed with a motion by the Hennepin County attorney's office to find him incompetent to stand trial and to dismiss the charges.

During his time at the hospital, Kmetz underwent several competency evaluations. Periodically he would be found competent and briefly freed, but then his behavior would result in a trip back to St. Peter, documents show.

Nathan Kmetz said that during his time at the hospital, his father felt stuck. "He pretty much played cards with the nurses, and the courts wouldn't let him out," he said.

In April 2013, a final evaluation found that he was suffering from an organic brain dysfunction that made a return to competency unlikely. Under those circumstances, his civil commitment was not extended, and he had accrued enough time at St. Peter to satisfy any sentence that would have been imposed had he been convicted of all of the 2009 charges.

Given those facts, the county attorney's office moved to dismiss the charges "in the interest of justice," the documents show.

Son: He was a 'good guy'

In a 2013 posting on the Minnesota Lawyer trade publication website, Nathan Kmetz wrote at length in objection to his father being civilly committed for mental illness.

The son wrote that the "unusual situation" had been going on for five years, saying that Hennepin County had his father committed even though doctors and nurses had stated that it was unnecessary.

"To be honest with you, who would be stable after being locked up in a nut house and having everything taken from them and nobody listening to them?" Nathan Kmetz said Tuesday. Kmetz said that despite his troubles, his dad was a "good guy."

"I know my dad," he said. "He's a hardworking, upstanding citizen for 45 years in his life."

He said he believes authorities "could have prevented [Monday's shooting] from happening" had his father's concerns and mental state been heeded.

But Marvin Kmetz, Raymond's brother, said he had feared that his brother's history of mental illness and violence could result in his death or that of others, documents say.

A litany of grievances

Raymond Kmetz had a long and troubled history with the criminal-justice system. Over the years, dozens of charges and civil actions had been filed against him. His own lawyers and prosecutors had filed restraining orders against him, which he violated. Recently he told one attorney's receptionist he "was going to end it all today."

Kmetz, who was divorced in 2010 and whose last address was Belle Plaine, owned a landscaping and construction business at times.

In 2008, he tried to sell the house on Nevada Avenue N. where he had lived for 40 years to the city of New Hope for nearly $1 million, though it was worth well below half that amount. He argued that it was in an industrial zone ripe for development. The council rejected the unsolicited offer. The property was last sold in 2013 for $140,000 and now is boarded up.

In August 2014, Kmetz appeared before the New Hope City Council and said he believed the city attorney was out to get him and planned to send police after him, his wife and sons. "You can get me, but leave my family alone," Kmetz said, looking directly at City Attorney Steve Sondrall.

Saying he was homeless, Kmetz told the council that he had "got busted up" and been shot with a Taser by five New Hope officers. That was in reference to a 2009 incident in which Kmetz failed to follow orders as the officer tried to arrest him on a warrant for making terroristic threats, records show. A lawsuit he filed over that incident was dismissed in March 2011.

Crystal police, whom Kmetz had repeatedly accused of wrongfully holding his property, including guns, also recorded incidents involving him, including one in which he tried to run over a Crystal police officer with a bulldozer.

That department filed a restraining order against him in August, when Kmetz told his son "he would go there with a gun" to retrieve his property, documents say.

New Hope City Hall was closed Tuesday as the investigation continued. A number of mysteries remain about Monday's shooting, including the source of Kmetz' gun and the timeline leading up to the exchange of gunfire.

Paul Walsh • 612-673-4482

Karen Zamora • 612-673-4647

David Chanen • 612-673-4465