SAN FRANCISCO (CBS SF) — After being on paid leave since December 2015, nine San Francisco police officers may now lose their jobs in a racist texting scandal that rocked the department.

A state appeals court overturned a lower court ruling Wednesday that blocked disciplinary proceedings against the nine officers, who were accused of sending racist and homophobic text messages in 2011 and 2012.

“This ruling upholds police departments’ ability to coordinate with federal investigators to expose dirty cops and protect the public,” City Attorney Dennis Herrera said in a statement.

The Court of Appeal said the proceedings begun in late 2014 didn’t violate a one-year statute of limitations because the administrative unit of the Police Department’s Internal Affairs Division didn’t receive the messages until then.

The text messages were discovered during the federal prosecution of former Sgt. Ian Furminger on charges related to the theft of money and property from drug suspects.

The U.S. Attorney’s Office gave the messages to the police administrative unit three days after Furminger was convicted of four charges in federal court in San Francisco on Dec. 5, 2014.

The existence of the messages became publicly known and caused an outcry when federal prosecutors included examples of some of them in a filing in March 2015 opposing Furminger’s bid for bail during his appeal.

In April 2015, following the internal investigation, then-Chief Greg Suhr filed disciplinary charges with the San Francisco Police Commission against nine officers.

He announced he was recommending that the commission fire seven officers and consider lesser discipline against two others. He said he would have recommended firing another officer, Michael Robison, who had already resigned.

But before the commission could act, Officer Rain Daugherty and eight other officers acting anonymously filed a lawsuit in San Francisco Superior Court and won an order halting the proceedings.

The officers argued the department violated the one-year deadline because some members of the criminal unit of the Internal Affairs Division had worked with federal prosecutors and knew of the messages.

But a three-judge panel of the appeals court in San Francisco noted that those department members were required to promise federal prosecutors to keep the information secret and were walled off from the administrative unit, which is responsible for disciplinary investigations.

The panel also said the state’s Public Safety Officers Procedural Bill of Rights Act, which contains the limit of one year after discovery of alleged misconduct, allows exceptions when criminal probes are pending.

The court, in an opinion written by Justice Martin Jenkins, said the law seeks to balance the public interest in maintaining the integrity and efficiency of the police with the right of officers to fair treatment.

Jenkins wrote, “There is no doubt that the public’s interest in the integrity of San Francisco Police Department was undermined by the offensive text messages.”

“The attitudes reflected in these messages displayed unacceptable prejudice against members of the communities SFPD is sworn to protect,” the court said.

“We’re very pleased the court found that police officials do not have to compromise a criminal investigation in order to pursue discipline against officers accused of abhorrent behavior,” Herrera said. “Forcing public officials to choose between the two would have made a mockery of justice.”

“It is high time to proceed with a full and fair disciplinary process for the officers in question,” Herrera said.