Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

CHARLESTON, W.Va. — A West Virginia police officer who was fired after he refused to shoot a man who had a gun has settled a lawsuit for $175,000.

The American Civil Liberties Union of West Virginia announced the settlement with the city of Weirton on Monday.

In the lawsuit, Stephen Mader said he did nothing wrong in May 2016 when he tried to persuade 23-year-old R.J. Williams of McKees Rocks, Pennsylvania, to put down his weapon. Another officer later saw Williams with his gun raised and fatally shot him. Williams' gun was unloaded. Mader said he determined Williams wanted to die by "suicide by cop."

Mader still maintains his firing was unjustified. In the statement, he said he was "happy to put this chapter of my life to bed. My hope is that no other person on either end of a police call has to go through this again."

Weirton City Manager Travis Blosser said Monday that the city stands by Mader's firing. Officials in Weirton, an Ohio River community of 19,000 residents 36 miles west of Pittsburgh, had said Mader was fired eight weeks after the shooting for conduct unbecoming of an officer in three separate incidents.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"We still feel we made the correct decision," Blosser said in a telephone interview. "We don't regret that decision. We feel we made the correct decision for the community."

Blosser said the decision to settle the lawsuit was made by the city's insurance carrier.

Williams was black and Mader is white. The shooting occurred in the midst of a national debate about whether race figures into law enforcement in the black community.

The lawsuit contended Mader was fired specifically for the Williams incident. Mader had said he would have done nothing differently. The lawsuit cited the state constitution, which prohibits a police officer from using deadly force unless the officer has reason to believe the target of such force poses an immediate threat of death or serious bodily injury to the officer or others.

According to the lawsuit, Mader responded to a call from Williams' girlfriend that he was threatening to hurt himself with a knife. Mader said his Marine Corps and police officer training taught him to assess a threat level. He said Williams was visibly upset but not aggressive or violent.

Mader believed Williams did not pose a risk of death or serious bodily injury to himself or others. After Mader ordered Williams to drop his unloaded gun, Williams responded, "I can't do that. Just shoot me," according to the lawsuit.

Stephen Mader received $175,000 settlement. Stephen Mader via ACLU

Two other officers arrived and when Williams raised his gun, one of the officers fatally shot Williams in the head. Investigations found the officer did nothing wrong.

Mader's lead attorney, Timothy O'Brien of Pittsburgh, said in the statement that Mader's attempt to de-escalate the situation "should have been praised, not punished. Simply put, no police officer should ever feel forced to take a life unnecessarily to save his career."

Mader's personnel file, previously obtained by The Associated Press through a Freedom of Information Act request, included an investigative report by a Weirton police captain who wrote that Williams presented "a clear and present danger" to others and recommended Mader's firing for several incidents.

In March 2016, Mader was issued a verbal warning for opening a car door to place a parking ticket inside without having a search warrant and cursing at the car owner's wife. A disorderly conduct charge against the owner was later dropped.

A month later, Mader responded to a call about a cardiac arrest and found a woman dead on a stairway. Mader determined the victim died of natural causes. He didn't fill out a police report, collected no evidence and the body was sent to a funeral home. Police Chief Rob Alexander called the handling of the suspicious death "unacceptable," and an autopsy determined the victim sustained blunt force trauma to the neck and upper torso.