PHOENIX (AP) — The Arizona Legislature late Monday approved a key part of a plan that will provide new opportunities for gambling at casinos owned by Native American tribes and for the first time allow sports betting both on and off reservations.

The Senate approved a bill passed last month by the House, sending it to Gov. Doug Ducey who negotiated the package and urged lawmakers to approve it.

The bill allows betting on professional and college sports at sites owned by pro sports teams and at tribal casinos. It also allows gambling on fantasy sports and new Keno games at horse race tracks and fraternal organizations.

Passage of the legislation is tied to the updated gaming compact Ducey has struck with tribes but has not released to the public.

In his January State of the State address, Ducey announced “an opportunity for a modernized gaming compact that will bring in more revenue for our tribal nations and our state budget.” The governor has been working on a new deal with tribes for several years, hoping it can boost state revenue by allowing gambling outside of tribal-run casinos.

The biggest part of the plan would allow pro sports teams like the Arizona Coyotes, Arizona Diamondbacks and Arizona Cardinals to run sports betting operations at their respective venues, at a retail location within a quarter mile and online. There would be 10 licenses awarded to sports, which could include professional golf and even NASCAR.

Tribes would also get 10 licenses and could run sports books at two dozen tribal casinos in the state.

The tribes, which have fiercely protected their exclusive right to most gambling in the state under the gaming compact approved by the state’s voters in 2002, get the right to build some new casinos under an updated deal. And in a big win, they would also be allowed to greatly expand their exclusive gambling offerings, adding games like Baccarat and craps to existing offerings of slot machines, blackjack and poker.

And there are options for online gambling as well, allowing growing online gambling sites like Draft Kings to piggyback on the licenses.

The state would allow any company that meets it standards to run fantasy sports gambling operations.

Both the legislation and a 20-year extension of the state’s gaming compact with tribes must be adopted for either to go into effect.

The amount of new revenue the state could receive hasn’t been officially estimated, but Rep. Jeff Weninger, a Chandler Republican who sponsored the bill, said it could easily exceed $100 million per year for the general fund.