BOSTON (WPRI) — After years of debate, lawmakers in Massachusetts have reached an agreement to legalize sports betting in the Bay State.

The decision came early Monday morning as lawmakers worked past the midnight deadline to wrap up its legislative session.

“I am proud to announce that the Sports Betting Conference Committee has reached an agreement on legislation that will legalize wagering on professional and collegiate sports in Massachusetts, bringing the immense economic benefits of a legal sports betting industry to MA,” Speaker Ron Mariano wrote on Twitter.

The 50-page bill says wagers placed at retail locations, like a casino, will be taxed at 15% and mobile bets will be taxed at 20%.

One of the major sticking points in the negotiations was betting on college games. Under the bill, you will be able to bet on college sports but only on games that do not include Massachusetts schools.

Mariano thanked other lawmakers for “recognizing the incredible economic opportunity that legalized sports betting presents.”

The bill now heads to Gov. Charlie Baker’s desk. If signed, Massachusetts will join 30 other states, including Rhode Island, as well as Washington, D.C., in legalizing sports betting.