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

Stephen Mader, 27, claimed he did nothing wrong in May 2016 when he tried to persuade R.J. Williams, 23, of McKees Rocks, Pa., to put down his weapon. Mader was an officer with the Weirton Police Department in West Virginia at the time of the incident.

Another officer later saw Williams with his gun raised and fatally shot him. Williams’ gun was unloaded. Mader said he determined Williams, a black man, wanted to die by “suicide by a cop.”

Mader, an Iraq and Afghanistan war veteran, said he believed he did the right thing and that his firing was unjustified. In a 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."

WEST VIRGINIA WOMAN DRAGGED OUT OF CAPITOL FOR READING LIST OF CORPORATE DONORS

Mader said Williams did not pose a risk of death of 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.

Weirton City Manager Travis Blosser said Monday, however, 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.

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

The lawsuit contended Mader was fired specifically for the Williams incident. Mader claimed the termination ruined his chances of becoming an officer in Weirton, The Washington Post reported.

The American Civil Liberties Union of West Virginia announced the city of Weirton settled the lawsuit with Mader on Monday for $175,000.

The incident began when 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 training taught him to assess a threat level. He said Williams was visibly upset but not aggressive or violent.

POLICE: INMATE FLEEING HOSPITAL SHOOTS, WOUNDS OFFICER

When the two other officers arrived, one of them fatally shot Williams in the head after he raised his gun. An investigation found the officer did nothing wrong.

Following the incident, the man who shot Williams texted Mader “calling him a ‘coward’ who ‘didn’t have the balls to save [his] own life,’” and dubbed him a “loud mouth piece of s---,” for talking to the press, court documents stated.

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 showed a Weirton police captain suggested his termination for several incidents because he presented “a clear and present danger.” 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 cursed 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 cardiac arrest and discovered a woman dead on a stairway. Mader determined the woman died of natural causes but failed to fill out a police report and did not collect evidence. 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.

The Washington Post reported Mader was no longer in law enforcement but was a truck driver now and lives in Weirton with his family.

The Associated Press contributed to this report.