The ruling by the Atlanta-based 11th U.S. Circuit Court of Appeals revives the lawsuit by former Tampa prosecutor Andrew Warren against DeSantis, who is among the Republicans competing with Donald Trump for party's 2024 presidential nomination.

A federal judge had dismissed the case last January, ruling that the courts had no power to reinstate Warren, a Democrat who won re-election in 2020, even though DeSantis' action violated state and federal law.

The appeals court overturned the decision, finding that Warren's statements did not affect his office's work and amounted to protected speech under the U.S. Constitution.

"The First Amendment prevents DeSantis from identifying a reform prosecutor and then suspending him to garner political benefit," it said.

DeSantis' spokesperson called the ruling "flat wrong" and said it was "an egregious encroachment on state sovereignty."

A representative for Warren had no immediate comment.

Warren announced on Jan. 8 he would not run again, saying DeSantis "could suspend me again for whatever bogus reason he wanted."

DeSantis had maintained he suspended Warren for "neglect of duty" after Warren and other prosecutors signed a statement supporting abortion rights.

Prosecutors across the country signed the pledge on June 24, the day the U.S. Supreme Court struck down its 1973 decision recognizing a constitutional right to abortion.

DeSantis in August suspended a second elected Democratic state prosecutor, Monique Worrell, the lead prosecutor in Florida's Orange and Osceola counties, accusing her of being soft on crime.

Worrell has called her dismissal an "attack on democracy" and is pursuing her own lawsuit against DeSantis in the Florida Supreme Court.

Polls show DeSantis trailing Trump in the Republican presidential nominating contest.

(Reporting by Mike Scarcella; Editing by David Bario and Bill Berkrot)

By Mike Scarcella