Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — Sunday's massacre in Las Vegas — the worst mass shooting in modern U.S. history — shone a light on Nevada's close partisan divide that has for years made it a national flashpoint in the battle over gun rights.

Both sides have poured millions of dollars into campaigns to restrict or loosen gun laws, efforts that have been spurred by high-profile shootings in Nevada and around the country.

Overall, the state's restrictions are relatively light. There are no permit requirements for purchasing handguns, rifles and shotguns, according to the National Rifle Association. Residents are allowed to carry guns openly throughout the state, a provision that attracted scrutiny when self-styled militia groups gathered in 2014 to support rancher Cliven Bundy's standoff with authorities.

"There is very little on the books," said Robyn Thomas, executive director of the Law Center to Prevent Gun Violence, a gun safety group.

Nevada gun laws NBC News

But debates over gun policy heated up in Nevada after another shooting that shocked the nation: the 2012 Newtown massacre, in which a gunman murdered 26 people at Sandy Hook Elementary School in Connecticut, 20 of whom were young children.

Led by President Barack Obama, the attack prompted a new push in Washington for laws expanding background checks to include private sales and gun shows. In Congress, 54 senators voted in 2013 for a bipartisan bill backed by Sens. Joe Manchin, D-W.Va., and Pat Toomey, R-Penn., but it failed to overcome a filibuster.

Sen. Dean Heller, a Nevada Republican, was considered a key swing vote and said he agonized over the decision.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Nevada had recent experience with mass shootings: In the days leading up to the vote, Heller deliberated over a meal at an IHOP in Carson City, where two years earlier a gunman killed four people, including three uniformed members of the National Guard.

Ultimately, Heller voted "no" on the bill, citing concerns over gun owners’ personal information.

In Nevada’s state government, though, the efforts continued on a parallel track. The state Legislature, controlled by Democrats, passed a background-check bill of its own.

The bill set off a major debate, with the National Rifle Association opposing it and gun safety groups like Mayors Against Illegal Guns promoting the measure.

But the bill never became law. Gov. Brian Sandoval, a Republican, vetoed it, saying the legislation represented an "erosion of Nevadans' Second Amendment rights."

Justin Jones, a former state senator who sponsored the bill, said the legislation was based on recommendations from experts in the wake of Sandy Hook.

"None of us know what would have prevented this tragedy, but certainly we could have done more in the state of Nevada to prevent gun violence," Jones told NBC News.

Things swung the opposite direction after Republicans won full control of state government in 2014.

Nevada Gov. Brian Sandoval David Becker / AP

The next year, Sandoval signed a gun bill with a suite of policies backed by Second Amendment activists. They included adding broader protections for people who defend their property (the so-called castle doctrine), and forcing Clark County, which includes Las Vegas, to no longer require handgun owners to register with local authorities. (The bill also included a ban on gun ownership for residents convicted of domestic violence.)

But gun safety advocates didn’t give up on background checks. Instead, they took the fight outside the state Legislature. In 2016, activists successfully petitioned to put the question to voters in a ballot measure, Question 1, that would require FBI background checks on private sales, with an exception for immediate family members.

The measure quickly became an expensive proxy war between gun rights groups like the NRA and opponents like Everytown for Gun Safety, which is backed by Michael Bloomberg, the former New York City mayor.

Nevadans for Background Checks, the main coalition backing Question 1, spent over $16 million during the election cycle, while NRA Nevadans for Freedom, the main opponent, spent about $6.5 million, according to campaign records. When the dust settled, it passed by a thin margin of just 50.4 percent to 49.6 percent.

But the new initiative never went into effect. The state's attorney general, Adam Laxalt, determined it was unenforceable because it required the FBI to perform background checks when the checks were the state’s legal responsibility. The FBI concurred, saying they would not participate.

Democrats retook the state Legislature in November, and Senate Majority Leader Aaron Ford said they were exploring legislative workarounds, but the session ended in June with nothing passed. Laxalt spoke at NRA’s national leadership forum in April, where he took credit for opposing Question 1.

For now, lawmakers in Nevada are striking a conciliatory tone across party lines in the wake Sunday's onslaught.

Republican and Democratic legislative leaders released a joint statement that praised the first responders at the scene. In a news conference, Sandoval commended the state's residents for their outpouring of support while avoiding any mention of policy debates.

"There's not much we can do, but we can learn," Sandoval said.