ATLANTIC CITY — The Superior Court judge who nixed the state's most drastic plan to pare back Atlantic City's fire department has given a green light for the state to lay off a smaller number — but not until February, when a new governor could end the state takeover.

In a ruling issued Wednesday, Judge Julio Mendez gave the state the OK to use layoffs to cut the department from 195 to his court-ordered minimum of 180, but not before giving 60 days notice after a federal SAFER grant expires Nov. 30.

The state had sought to go as low as 125 firefighters, but the judge ruled that any reduction below 180 would compromise public safety. Mendez recommended relying on attrition and retirement to achieve the lower number, but concluded that the legislation authorizing the takeover gives the state the authority to use layoffs. As recently as January, the department had 225 firefighters.

The judge's time line pushes any layoffs to February, allowing the department to pursue other funding sources. Both gubernatorial candidates, Democrat Phil Murphy and Lt. Gov. Kim Guadagno, have indicated that they might end the state takeover if elected. There could also be a new mayor, as Democrat Frank Gilliam is challenging incumbent Republican Don Guardian.

The state assumed vast powers over the nearly broke Atlantic City government last November, and Gov. Christie essentially outsourced that authority to a West Orange law firm run by his longtime ally Jeffrey S. Chiesa, a former state attorney general who served briefly as an appointed U.S. senator. He bills at $400 an hour.

The law firm, using a dozen or more of its partners and associates, is approaching $3 million in fees for its work, much of it stemming from lawsuits involving efforts to change the contracts of the city's police and fire departments. The state also renegotiated tax appeals due the Borgata and other casinos, defusing those crises but keeping the city deep in debt for the foreseeable future.

Guardian, who supported the firefighters' union in fighting the cuts sought by the state, said he was disappointed that the state has not offered the firefighters an early retirement package approved by the state legislature.

"We could have easily gotten to 180 fighters through these incentives," Guardian said. "The only saving grace is that Judge Mendez wisely ordered that no action be taken until February 2018, which is when the next round of SAFER goes into effect."

Fire departments rely on SAFER (Staffing for Adequate Fire and Emergency Response) grants to help sustain the number of firefighters in their ranks.

John Varallo Jr., president of Local 198 of the firefighters' union, said the union was still open to a negotiated solution.

"Ultimately I think Mendez wants us all to come to a reasonable conclusion, to try to figure this out so people don't hurt," Varallo said. "He's just giving us time to sit down and work this out ourselves. I would just hope they come to the table."

Lisa Ryan, a spokeswoman for the state overseers, said in an email that the state remains disappointed by the court's insistence on "an artificially and unnecessarily high number of firefighters." She warned that the "modest" reduction of 15 allowed by the judge will prompt the state to make "additional and significant reductions to fire salaries."