PROVIDENCE, R.I. (AP) — With billions of dollars and the retirement security of public workers at stake, the legal dispute over Rhode Island's sweeping overhaul of its public pension system heated up Friday as the state asked a judge to dismiss the challenges filed by public-sector unions and retirees.

Attorney John Tarantino, the state's lead attorney, told Superior Court Judge Sarah Taft-Carter that the unions failed to make their case that lawmakers violated workers' contracts when they passed legislation to suspend pension increases and alter retirement benefits. He said benefits set through state law don't amount to a contract.

But lawyers for the unions and retired government workers insisted that retirement benefit agreements do constitute a contract, and that their challenge should be allowed to continue.

Taft-Carter did not say when she would rule on the motion — which could be only an early skirmish in what's expected to a protracted and complicated legal fight.

The outcome of the case could have far-reaching implications as states around the country wrestle with nearly $1.4 trillion in unfunded pension promises. Rhode Island, which had struggled with one of the most underfunded systems in the nation, drew national attention when lawmakers voted last year to suspend pension increases, raise retirement ages and merge pensions with 401(k)-style accounts to reduce its pension bills by an estimated $4 billion over the next two decades.

Without the changes, state leaders warned that pension costs would have consumed more and more public dollars, reducing funds for education and other programs and ultimately hurting the very workers served by the pension system. Before the law was passed, Rhode Island's pension costs were set to rise from $319 million in 2011 to $765 million in 2015 and $1.3 billion in 2028.

Tarantino said the unions' challenge to the law should be thrown out because they haven't shown that lawmakers intend to create a contract when they vote on pension benefits.

"The role of a legislature, its function, is not generally to make contracts. They make policy. They make law," he said. "... We don't want the judicial system, as good as it is ... to basically second-guess what the legislature is doing."

But attorney Carly Iafrate, arguing for retired workers, said teachers and government workers are entitled to the same employment and contract rights as any other worker — even if their benefit agreements are set by legislators.

Taft-Carter did not discuss whether she wants both sides of the dispute to negotiate. Gov. Lincoln Chafee, a key supporter of the pension law, has said he wants to pursue a settlement with unions to avoid what could be a fiscal calamity if the state should lose. Treasurer Gina Raimondo, the main architect of the law, opposes negotiations and has said she wants to see the court challenge play out.

Iafrate said the judge "did raise the issue" of negotiations during discussions with both sides. Tarantino declined to comment about any talks that might be under way.

Also on Friday, Taft-Carter agreed to let high-powered New York attorney David Boies join the state's legal team. Boies is famed for his work representing the government in its antitrust case against Microsoft and in Al Gore's unsuccessful presidential campaign challenge in the U.S. Supreme Court. He said defending the state's pension overhaul is important to the entire country.

"This is a critical case for Rhode Island but it's a critical case nationally," Boies said. "I think Rhode Island is a leader."

The state again sought to have Taft-Carter removed from the case because her uncle draws state retirement benefits. The state had earlier asked the judge to recuse herself because her mother also receives a state pension and because her son, a state police officer, is a member of the pension system as well. As a judge, Taft-Carter herself will be eligible for a pension when she retires.

Taft-Carter denied the state's motion for a recusal and insisted that her work in the case "will be and can be fair and impartial."

An earlier ruling by Taft-Carter on another pension case could foreshadow where the lawsuit is heading. Last year, Taft-Carter ruled that pension agreements are an implied contract and cannot be broken "on a whim." In her decision, she wrote that the state can modify its contracts with workers only if it can show such actions are necessary and reasonable.

Iafrate predicted the case could turn on the question of whether the law was necessary and reasonable.

"This is only the beginning," she said of Friday's action. "This is step one."