OMAHA, Neb. — A federal appeals panel has ruled against Washington County Sheriff Michael Robinson, who had sought to end a lawsuit against him by a deputy he fired after the deputy unsuccessfully challenged him for election in 2014.

Deputy Donald Morgan was fired six days after losing the primary election to Robinson. The sheriff cited campaign statements Morgan had made about deficiencies within the department for the firing. Morgan said in the lawsuit that the firing violated his First Amendment right to free speech. An arbitrator later ordered Morgan be reinstated to his job.

Robinson sought to have the lawsuit against him dismissed, claiming qualified immunity, which shields public officials from liability. A U.S. District judge ruled against him in late 2016, and he appealed.

On Friday, a three-judge panel of the 8th U.S. Circuit Court of Appeals upheld the lower court’s decision, saying Morgan’s campaign statements were protected speech.

The appeals opinion said public officials “have been on notice” since 1968 that they may not sanction an employee for uttering protected speech when that speech doesn’t affect the employee’s official duties or detract from office efficiency.

“This is all the more true given the context in which Morgan spoke here: a political campaign, where ‘the First Amendment has its fullest and most urgent application,'” the court said, citing previous case law. “To the extent that there remains any ambiguity, we hold that a public employee cannot be terminated for making protected statements during a campaign for public office where that speech has no demonstrated impact on the efficiency of office operations.”

Morgan’s attorney, Tom White, pointed to that statement in the opinion, saying it “really steps up protection in the 8th Circuit” of public employees’ free speech rights.

“This is really a wake-up call to people who would abuse their authority to try to shut up public servants to keep them from speaking up about problems in their agencies,” White said.

Robinson’s attorney, Charles Campbell, said Friday’s ruling did not come as a surprise, given the questioning from judges during oral arguments. He plans to file a request for the full 8th Circuit to reconsider the appeal.