PROVIDENCE, R.I. (AP) — A judge hearing a challenge by public-sector unions and retirees to Rhode Island’s landmark pension system overhaul on Tuesday ordered the parties into federal mediation a little over a week after the state asked her to dismiss the lawsuit.

Superior Court Associate Justice Sarah Taft-Carter said Tuesday that she had met with the parties in a pretrial conference and that they had all agreed to try mediation in the case. The litigation, or a negotiated settlement, could have far-reaching implications as states across the country grapple to close the vast gap — more than $1.4 trillion nationwide — between what they have set aside for pensions and what they have promised their retirees.

Unions and retired government workers in Rhode Island sued to overturn the 2011 pension law, which raised retirement ages and suspended pension increases. Their lawyers argue that the changes are unconstitutional and unfair in that they amount to a breach of contract.

Lawyers for the state, meanwhile, maintain that benefits set through state law don’t amount to a contract. Treasurer Gina Raimondo, the main architect of the overhaul, and other state leaders say that without the changes, sky-rocketing pension costs will swamp state finances.

The state this month asked Taft-Carter to throw out the suit, but she didn’t issue a ruling. She will not participate in the mediation.

The state’s own leadership hadn’t agreed on whether they wanted to pursue negotiations. Raimondo had said she wanted the court challenge to play out. But Gov. Lincoln Chafee had indicated a willingness to try to reach a settlement with the unions, saying the state could face disastrous fiscal consequences if it were to lose in court.

In a statement Tuesday, Raimondo said she continues to believe the state has a “very strong” legal case. But she also said the state will participate in the court-ordered mediation in good faith.

“I have great respect for the judicial system and it is important to let this process unfold in an orderly and transparent way,” she said. “We owe that to the people of Rhode Island and to our public employees.”

A spokeswoman for Chafee couldn’t immediately be reached. Officials at the National Education Association Rhode Island and the state AFL-CIO also couldn’t immediately be reached.

The parties in the pension challenge have been referred to the Federal Mediation and Conciliation Service in Washington, D.C. Taft-Carter will be updated on mediation efforts Feb. 1.

Meanwhile, the litigation will continue on a path toward trial.