BAILEY, Colo. (AP) — Martin Wirth spent recent years fuming over police brutality and corrupt mortgage companies, fueled by his own run-ins with the law and a yearslong battle to salvage his two-story home in the forested Colorado mountains from foreclosure.

That fight came to a violent end Wednesday when Wirth, 58, shot three law enforcement officers trying to serve an eviction notice, killing one and wounding the others, authorities said. Officers fired back, killing Wirth.

As some close to Wirth struggled to reconcile the shooting with their memories of him as a well-intentioned activist, others recalled a quick-tempered man with a propensity for violence. He wrote disparagingly of the government and police in seething posts on his Facebook page.

“They are a brutal impediment to human progress a danger to us all,” one post said. “Because I write such things, cops want me dead.”

Aware of the danger, eight officers from the Park County Sheriff’s Office went to the home in a hillside neighborhood north of the town of Bailey to serve what authorities described as a “high-risk” eviction notice.

The shooting killed Corporal Nate Carrigan, a 13-year veteran of the sheriff’s office. One of the wounded officers underwent surgery for life-threatening injuries and was in critical condition. The other was treated and released from a hospital after a bullet grazed his ear.

The shooting shook the community where the deputies were familiar faces.

“The deputies are one of us and they live with us and they’re friends and neighbors and any time there’s a loss it a loss for all of us,” resident Allison Henry said.

Court records show Wirth had several brushes with law enforcement over the years, including a January arrest for eluding a police officer, obstructing a law enforcement animal, and driving without insurance and a license.

Dan Spykstra successfully sought a protection order against Wirth in 2005 after Wirth made violent threats against him while enrolled in court-ordered drug and alcohol counseling. Spykstra was running the program at the time. Wirth went off on an employee, and Spykstra said he confronted him.

“I believed the threats were serious, I did not think they were jokes,” Spykstra said. “He was a person who was constantly saying the government was out to get him. Nothing was his fault, it was always someone else’s.”

Carrigan and Capt. Mark Hancock, who was wounded, coached Spykstra’s son on the local high school’s football team.

“He was always very supportive and wise beyond his years, a really good kid,” Spykstra said of Carrigan.

Wirth owned his home until March 2014, when Fannie Mae, the government-controlled mortgage company, took ownership after he lost a court battle over his foreclosure.

“It seems to me that he was just pushed to the end of his rope, and he tried every single approach to addressing his grievances, and at the end, he chose to not let them take his house away from him,” said Tim Holland, who was involved in the Occupy Denver movement with Wirth. “It’s the middle of winter in the mountains. Where was he going to go?”

After Wirth lost his case in state court, he sued Colorado Gov. John Hickenlooper, the state attorney general and a judge in 2013. The federal lawsuit claimed that state foreclosure laws were unconstitutional and that Wirth and his unnamed guests were “in imminent danger of being wrongfully deprived of home and property while also being threatened with an armed and forcible entry onto the property and into the home.”

He asked a federal judge to block Park County from selling his home, evicting him or forcibly entering the house and to strike down several state laws. A federal judge dismissed the lawsuit last September.

Wirth ran for the state Senate in 2014 as a Green Party candidate, but he lost to an incumbent Republican.

The area of rocky, pine-covered hills is about 45 miles southwest of Denver where several camps host Girl Scouts and other youth during the summer. The neighborhood is several miles outside Bailey, a hamlet of just a few restaurants and shops.

There, a gunman took several girls hostage in a high school classroom a decade ago, killing one before himself.

___

Gurman reported from Denver. Associated Press writers Colleen Slevin and Matt Volz contributed to this report.