A police officer who was fired after trying to persuade a man to drop his gun before he was fatally shot by two other officers is suing the city over his termination.

Stephen Mader, a former police officer in Weirton, West Virginia, who previously served in the Marines, filed a civil complaint against the city in federal court Tuesday, alleging Weirton officials fired him because he didn't shoot Ronald J. Williams, a 21-year-old African-American man.

Williams' girlfriend called 911 on May 6, 2016, reporting that Williams was threatening to kill himself, according to Mader's lawsuit. Williams then grabbed a handgun from his car, prompting his girlfriend to place a second 911 call to tell police that Williams' weapon was unloaded, the lawsuit says.

Mader, a former Marine, says the Weirton Police Department fired him for not shooting a black man with a gun. ACLU of West Virginia

Mader arrived on the scene and ordered Williams to show his hands and drop the gun, to which Williams replied, "I can't do that. Just shoot me." Mader claims he concluded Williams was hoping to commit "suicide by cop" and attempted to calm him down.

Get Breaking News Delivered to Your Inbox

Two other officers arrived and Williams raised his gun, the suit claims. One of the officers opened fire, striking Williams in the head and killing him. A police investigation determined the shooting was justified.

On June 7, Mader's superiors in the police department informed him he was being let go, the suit says. The termination letter said Mader "failed to eliminate a threat" by not opening fire on Williams, according to the Pittsburgh Post-Gazette, which first published details of Mader's firing in September 2016.

Weirton officials forcefully disputed the Post-Gazette story at the time. Police chief Rob Alexander told CBS affiliate WTRF-TV Mader was terminated because he "escalated that situation rather than deescalating it," saying the decision had nothing to do with Mader not shooting Williams.

The ACLU of West Virginia, which filed the lawsuit on Mader's behalf, said the city "engaged in a pattern of retaliation designed to destroy his reputation" after he spoke to the press about Williams' death.

"To tell a police officer -- when in doubt -- either shoot to kill, or get fired, is a choice that no police officer should ever have to make," lead counsel Timothy P. O'Brien said in a statement.