And just like that, it’s over. Years of acrimonious accusation, nonpayment of revenues and stubborn refusal came to a sudden and fair end on Thursday when Gov. Andrew M. Cuomo and Seneca Nation President Barry Snyder settled their differences over casino gaming in Western New York.

With their agreement, the financial gun aimed in Niagara Falls was lowered and the threat to the Senecas’ monopoly on big-time casino gambling was resolved. Everyone came out a winner, especially Cuomo, who showed he knows how to play a hand.

Peace Bridge worriers, take note.

The past few years have been desperate times in Niagara Falls, which, by hosting the Seneca Niagara Casino within its borders, was due a share of the casino’s slot machine revenues.

The Senecas had been withholding payments due the state, which in turn was supposed to pay the city, over the state’s approval of gambling at racetracks in Hamburg, Batavia and Canandaigua.

The Senecas said those racinos violated the exclusivity zone provided by the 2002 compact signed by the state and the Senecas. On Thursday, Cuomo acknowledged the obvious and agreed that the Senecas’ point was “legitimate.”

With Thursday’s agreement, and assuming approval by Seneca Nation’s council, Niagara Falls will reap a windfall of $89 million in delayed payments. The two other cities hosting Seneca casinos, Buffalo and Salamanca, will receive $15.5 million and $34.5 million, respectively. It’s not found money, but revenue these municipalities were owed and upon which they had counted.

That is especially true for the struggling City of Niagara Falls, which had cut back road paving, saw its credit rating lowered twice and faced the possibility of running out of money before the end of this year. The infusion of $89 million will help, but the city shouldn’t set off on a spending spree. The Falls still faces serious budget problems.

With the deal, Cuomo has withdrawn his threat to locate another casino in Western New York, quite possibly in Niagara Falls. He is also accepting $209.8 million less than the Senecas actually owed the state, presumably as penance for the state’s having encroached on the Senecas’ exclusivity zone. New limits will be placed on the games offered at the three racetrack slot parlors, and on their signage and marketing.

The deal could also benefit all Western New York counties. If the state approves a referendum allowing for expansion of casino gambling in areas of the state not covered by contracts with Indian nations, then the state will forgo its take from the three Western New York casinos, and divide that up among the counties. Niagara Falls, Buffalo and Salamanca would continue to receive their full share of revenues.

This came together now because of the pressure of a looming deadline. The end of the current session of the New York State Legislature arrives on Thursday and, by then, Albany could have authorized a new casino in Western New York, a casino that would have seriously cut into the huge profits from the Seneca Niagara Casino. With that threat (which may have been a gambler’s bluff by Cuomo; we’re sure he’ll never tell), it became time to be serious.

Is something similar happening with the dispute over the Peace Bridge Authority? It’s hard not to see the parallels. As with the casino standoff, Cuomo now has leverage: legislation that could abolish the authority if he signs it.

How that dispute will be resolved – or if it will be resolved – remains unknown, but Cuomo’s agreement with the Senecas shows that even with leverage, the facts make a difference and that he is open to a fair resolution. Here’s hoping one is in the offing.