CARSON CITY, Nev. — Gov. Brian Sandoval signed legislation Thursday legalizing online gambling in Nevada, capping a dizzying day at the Legislature as lawmakers passed the bill through the Assembly and Senate as an emergency measure.

Nevada wanted to beat New Jersey, its East Coast casino rival, to the online gambling punch. New Jersey Gov. Chris Christie previously vetoed an online wagering bill but has indicated he may sign an amended version next week.

Sandoval and Nevada legislative leaders said it was important for Nevada to remain at the forefront of gambling regulation.

“This is an historic day for the great state of Nevada,” Sandoval said, flanked by dozens of state lawmakers. “Today I sign into law the framework that will usher in the next frontier of gaming in Nevada.”

Sandoval, a former chairman of the Nevada Gaming Commission added, “This bill is critical to our state’s economy and ensures that we will continue to be the gold standard for gaming regulation.”

He praised legislators for their swift action and commended Assembly Majority Leader William Horne, a Democrat from Las Vegas, for shepherding the bill.

Horne, in turn, had equal accolades for the Republican governor.

“This was a lot of work and it couldn’t have been done without the governor’s leadership and vision,” he said.

Horne couldn’t resist at jab at Nevada’s gambling rivals.

“As to our competitor, New Jersey, they should be accustomed to following Nevada,” he said.

AG Burnett, chairman of the Nevada Gaming Control Board, said the state already has about 20 applications from various operators, equipment and software vendors to be licensed for online gambling.

AB114 authorizes Nevada to enter into compacts with other states to offer Internet poker. It sailed through both the Assembly and Senate on Thursday after a joint hearing before the two judiciary committees.

Gambling regulators will now come up with regulations dictating compact parameters.

Lawmakers in 2011 passed a bill that put Nevada in position to legalize Internet gambling if the federal government sanctioned it. But when those efforts failed in Congress, Sandoval said Nevada would work toward agreements with other states.

Several other states began looking into online gambling after the Department of Justice issued a letter in 2011 stating that the federal Wire Act of 1961, often used to crack down on gambling over the Internet, only applies to sports betting.

Partnering with other states gives Nevada an expanded customer market and provides other states with Nevada’s expertise in gambling regulation.

Pete Ernaut, a lobbyist representing the Nevada Resort Association, said expanding the customer base was key.

“It’s imperative for the success of this that we compact with other states because we don’t have a universe of players,” Ernaut said.

The benefit for other states, he said, is Nevada’s “most mature regulatory infrastructure.”

“We have the most mature financial, auditing and collection capabilities, much greater than some of those states, and they have the players,” he said.

The bill approved Thursday resolved a disagreement between Horne and the governor’s office over licensing fees. Sandoval had pushed for companies that want to offer online gambling to pay a $500,000 fee, while Horne, in the original bill draft, proposed $1 million.

Under a compromise, the fee was set at $500,000, though it gives the Nevada Gaming Commission authority to change the amount. A renewal fee was set at $250,000.