(Bloomberg) -- A surge in online gambling helped lift New Jersey tax collections in an otherwise terrible year for the casino industry, bringing some relief to the state during a budget crunch.

Casinos, racetracks and online gambling providers generated $302.7 million in tax collections for the state in 2020, up from $300.4 million the year before, according to data released Wednesday by the state Division of Gaming Enforcement.

The coronavirus pandemic crippled New Jersey casinos last year, shutting them down for nearly four months. Though they began reopening in July, gamblers are only slowly coming back. The state’s nine land-based casinos generated $1.5 billion in total gambling revenue, down 44% from the prior year.

Against that backdrop, online wagering was a lifeline. Revenue from those bets -- including games like poker and blackjack, as well as virtual slot machines -- doubled to $970 million. Sports betting, which was hurt somewhat by the shutdown of live sports earlier in the year, still climbed 33% to $398 million.

The numbers may be closely watched by legislators in states such as New York that are considering an expansion or introduction of online wagering.

Although the increase in revenue from internet wagers didn’t make up for all of the sales lost in physical casinos, the tax collections were greater because online revenue is taxed at higher rates. Traditional casinos are taxed at 8% of sales. Online games have a rate of 15%. Sports wagers are taxed at 8.5% if they are placed in casinos and 13% if placed online.

©2021 Bloomberg L.P.