In a marathon session ending at 7 a.m. Saturday, the state Senate gave final passage to the bill to bring four Las Vegas-style gambling casinos to upstate New York and protect Turning Stone and other Indian casinos from nearby competition.

Now that the bill has passed both houses, it is expected to be signed into law by Gov. Andrew Cuomo, who successfully pushed for the biggest expansion of casino gambling in New York state history and the largest since lawmakers fast-tracked a gambling expansion following 9/11.

The Upstate NY Gaming Economic Development Act serves as the legal blueprint for rolling out casinos if voters approve a gambling constitutional amendment in November to allow the operation of non-Indian commercial gambling casinos. The bill gives the Oneida Indian Nation the exclusive rights to run casinos in “Region Four,” the state’s designation of a gambling district that includes Cayuga, Chenango, Cortland, Herkimer, Lewis, Madison, Oneida, Onondaga, Oswego and Otsego counties.

The Mohawk tribe has similar exclusive rights under the bill to for gambling casinos in Clinton, Essex, Franklin, Hamilton, Jefferson, Lewis, Saint Lawrence and Warren counties. The Seneca tribe has exclusive rights for the entire western half of the state from Route 14 west. The north-south highway runs from Lake Ontario to Pennsylvania, roughly in a straight line just to the west of Seneca Lake.

If the new casinos are built, they are expected to be somewhere in the Catskills and the Saratoga Springs-Albany Northway corridor. Their location will be determined by Cuomo appointees, with input from local officials in potential host communities.

The Oneida tribal officials praised passage of the bill, which also settles land disputes, permitting the Oneidas to purchase up to 25,000 acres of land and put it in a federal trust. The details are subject to review and approval of the federal government, which opened the gambling floodgates in 1988 with passage of a law that permitted Indians to operate gambling parlors in any state where other forms of gambling were permitted, such as bingo or lottery games. There are also several towns and citizens’ groups pressing forward with legal actions tat would undo various provisions of the deal.

“The Oneida Nation commends the New York State Legislature for joining the Madison County Board of Supervisors and the Oneida County Legislature in approving this unprecedented agreement,” Oneida Nation Representative Ray Halbritter said in a press release sent out Friday night. “By working hard and selflessly together, the state, both counties and the Oneida Nation have resolved all of the legal disputes between our peoples, once and for all.”

“As we begin this next chapter, we do so as partners working to build shared prosperity for future generations, and a new trust to address any new issues that may arise. The unwavering commitment of Governor Andrew Cuomo, Oneida County Executive Anthony Picente, and Madison County Board of Supervisors Chairman John Becker played an essential role in making this moment possible.”

The bill lays out payments that will go to Oneida and Madison counties, including giving Oneida County 25 percent of the state share of annual “net drop from all gaming devices” and Madison County $3.5 million a year and a one-time $11 million payment. Also for 19 years and three months, Oneida County will get an annual payment of $2.5 million.

The bill also permits two VLT video lottery parlors on Long Island.

Even if voters reject the casino gambling constitutional amendment, the bill authorizes Cuomo’s new Gaming Commission to continue to expand gambling.

“In the event that the gaming referendum does not pass, the Gaming Commission is authorized to competitively site up to four video lottery gaming facilities, one per region, in the Capital District, Eastern Southern Tier, Catskills, and Nassau County, based on revenue generation and economic development criteria,” Cuomo said in announcing the deal on the bill this week. “Additional video lottery gaming facilities in New York will secure new funding for educational assistance.”