ATLANTIC CITY - A judge has allowed the Borgata casino to stop paying taxes to the Shore resort city until it hands over $62.5 million in court-ordered tax refunds.

That move could cause the cash-strapped city to run out of money within weeks. Mayor Don Guardian said it would be "devastating" if the Borgata withheld a tax payment due next week.

Atlantic City owes more than $170 million to the Borgata in tax appeals that the casino won by challenging the property's assessed value as the city's gambling market shrank amid cutthroat competition in the Northeast.

The casino's statement came shortly after Superior Court Judge Julio Mendez granted a motion Friday declaring that the city must pay the Borgata $62.5 million for tax years 2009-10 - payments that have been ordered and upheld by court rulings.

The judge barred the casino from moving to seize city assets to collect the judgment for at least 45 days, so that settlement talks can occur. But he allowed the Borgata to stop making current tax payments while the case remains unresolved, as it has the right to do.

"We did not come to this decision lightly," said Joe Corbo, the Borgata's general counsel. "We have been tremendously patient, giving city officials every opportunity to pay the amounts we are owed, or to engage us in good-faith negotiations.

"But after years of delays and unsuccessful appeals by the city, we can wait no longer," he said, citing obligations to the casino's shareholders.

Guardian has said the debt could force the city into bankruptcy. On Friday, he said the city would seek mediation with the Borgata and the state over the unpaid debt, and expressed relief that the judge had temporarily barred the casino from going after the city's bank accounts.

"Although there is no doubt that we owe Borgata money back from prior rulings, the question has always been, how do we pay them back fairly and reasonably, given our current fiscal constraints?" he said. "Having Borgata exercise the option not to pay their first-quarter taxes would be devastating to Atlantic City."

Corbo said the casino remained willing to negotiate with the city and the State of New Jersey in its oversight role of Atlantic City's finances, but said the city had yet to make a serious offer.

In addition to the $62.5 million it is owed for tax years 2009-10, the Borgata reached a settlement with the city for tax years 2011-14 of $88.25 million, which was supposed to be paid by Dec. 31, 2014. It was not, and both sides continued to talk, but no agreement was reached.

The $170 million includes interest, Corbo said.

The failure of the city to meet the 2014 deadline enabled the Borgata to reinstate its tax appeals for those four years.

Atlantic City is grappling with severe budget problems caused by years of decline in its casino industry - by far its largest industry and taxpayer.

State officials also accuse the city of decades of overspending and poor financial management, and have proposed taking over most of the city's major decision making authority, including the right to sell off city assets and land.

A bill is pending in the Legislature to give the state vast power over the city's operations.