A lawyer for Baltimore's top prosecutor asked a federal appeals court Wednesday to dismiss a lawsuit by five police officers who claim she maliciously prosecuted them in the death of a black man gravely injured in police custody.

Assistant Attorney General Karl Pothier told the three-judge panel that as a prosecutor, Marilyn Mosby has immunity from the lawsuit filed by officers who were charged but later cleared in the arrest and death of Freddie Gray. Pothier urged the 4th U.S. Circuit Court of Appeals to overturn a judge's decision to allow parts of the lawsuit to go to trial.

Gray, 25, died on April 19, 2015, of a spinal injury suffered in a police van, prompting days of widespread protests and rioting. While tensions were still smoldering in Baltimore, Mosby charged six officers in Gray's arrest and death, an announcement that brought celebrations in the streets.

Three were ultimately acquitted and Mosby dropped the remaining cases.

On Wednesday, Judge J. Harvie Wilkinson III grilled the officers' lawyers about why they should be allowed to sue Mosby for bringing criminal charges against them and holding a news conference to announce the charges.

“What we're talking about here is muzzling prosecutors who have publicly expressed grounds for prosecuting police officers,” said Wilkinson, who repeatedly raised his voice while questioning the officers' lawyers.

Five of the officers sued Mosby. They allege in their lawsuit that Mosby did not have enough evidence to charge them and that she omitted key information about a witness who had observed that Gray was conscious during much of the ride in the police van. They also said evidence was withheld from another witness who said Gray was banging his head against the wall of the van while he was in custody.

The officers also claim that Mosby prosecuted them to ease public unrest after Gray's death.

The U.S. Department of Justice in September declined to bring federal civil rights charges against the six officers — three white and three black — meaning none could be held criminally responsible for Gray's death. And in recent weeks, the police van driver and the highest-ranking officer in Gray's arrest also were cleared of any administrative wrongdoing by a police panel. Police Commissioner Kevin Davis subsequently decided to scrap a final trial board.