Virginia lawmakers on Sunday gave final approvals to a pair of bills legalizing casinos and sports betting after a last-minute fight over whether the state should allow bets on college games involving Virginia teams.

In the end, lawmakers chose to exclude Virginia colleges and universities from the new sports betting market, bowing to concerns raised by higher education leaders who said they wanted to shield student athletics from gambling’s influence.

Together, the two bills represent a major expansion of gambling after decades of resistance in the legislature. But the promise of additional tax revenue and keeping gambling dollars in Virginia secured bipartisan support for the bills, which passed over opposition from some Republicans who said they were concerned about the social impacts on families and low-income communities.

The sports betting legislation could have the most immediate impact for the state.

If Gov. Ralph Northam signs the bills, sports betting could be available through mobile apps and websites by the end of the year. Casinos would take a little longer, requiring voter referendums in five cities – Bristol, Danville, Portsmouth, Norfolk and Richmond – the General Assembly chose as possible casino sites. Those referendums could happen as early as November.

A coalition of gambling interests and local leaders lobbied the legislature to pass the casino bill, pitched as an economic lifeline for the five targeted cities.

“It’s going to create jobs,” said Del. Barry Knight, R-Virginia Beach. “So these people can lift themselves up.”

As legislators worked through the weekend on the state budget and dozens of other pending bills, they worked to finalize tax rates and regulatory structure for the new forms of gambling.

College sports emerged as a key sticking point in the sports betting debate as lawmakers went back and forth over whether they should sanction bets on Virginia teams. Opponents of the idea suggested it would be inappropriate to promote gambling on games played by student-athletes.

“These are 18-, 19-, 20-year-olds,” said David Bulova, D-Fairfax, who urged his colleagues to oppose the inclusion of Virginia schools in the bill.

Others argued that if the state is going to regulate and tax sports betting that’s already happening anyway, it should cover all games.

“For me, it’s about taking what’s happening out in the gray market and the black market and bringing it into the light,” said Del. Marcus Simon, D-Fairfax.

To reach a compromise, legislators agreed to exclude Virginia college sports but lower the tax rate on sports betting from 17.5 percent to 15 percent.

The bill prohibits prop bets on college sports, which means bettors could only wager on the outcome of games, not the performance of individual players or in-game events.

The sports betting bill allows the Virginia Lottery to issue between four and twelve permits for digital wagering platforms. Those permits would be available to established sports betting platforms like FanDuel and DraftKings. Other gambling interests like Colonial Downs and companies in the process of opening brick-and-mortar sports books at casinos could also apply for sports betting permits.

The bill also allows professional sports teams like the Washington Redskins to pursue their own sports betting platforms, as long as their headquarters is in Virginia. It would also allow the Redskins to potentially open their own brick-and-mortar sportsbook if the team builds a new stadium in Virginia.

Colonial Downs Group – the company that owns the New Kent County horse racing track and several satellite facilities with off-track betting and slots-like historical horse racing machines – won a concession in the bill raising the statewide cap on how betting machines it can operate. The company is currently limited to 3,000 machines, but the bill would allow another 2,000, with up to 1,650 machines at a facility planned for the town of Dumfries in Northern Virginia.

Colonial Downs requested the additional machines as protection from the financial hit it could take when casinos open. Each time a city approves a casino referendum, Colonial Downs would get 600 more machines, up to the 2,000-machine limit.