NEW YORK — Voters rendered a split decision on gun control measures in the election, approving universal background checks for private firearms sales in Nevada while narrowly rejecting them in Maine.

Gun safety advocates had poured millions of dollars into backing the initiatives in an effort to combat the political might of the gun lobby’s National Rifle Association.

The measure was defeated in Maine by 51.0 percent of votes to 48.9 percent, or about 12,700 ballots, the Bangor Daily News reported. Nevada voters approved a similar proposal by 50.5 percent to 49.6 percent, state election officials said.

Both ballot initiatives were backed by Everytown for Gun Safety, the gun control group founded by billionaire former Mayor Michael Bloomberg, and polls had suggested the measures would pass.

The votes were seen as a crucial test of the gun safety campaign’s decision to adopt a state-by-state strategy after efforts to pass legislation failed in Congress.

Gun control supporters won victories in two other states. Washington state voters easily approved a measure giving judges the power to keep dangerous individuals, such as accused domestic abusers, from possessing guns. In California, residents backed a referendum that bans large-capacity ammunition magazines and requires some people to undergo background checks in order to buy ammunition.

The U.S. Constitution’s Second Amendment protects the right to bear arms, and gun rights advocates fiercely contest any attempt to restrict it.

Opponents had said the background check laws were not clear and would do nothing to stop criminals.

“We know today that the place where criminals are getting guns, the black market, they aren’t subjecting themselves to background checks,” said Ryan Hamilton, a spokesman for the National Rifle Association-backed opposition in Nevada, before Election Day. “It doesn’t target criminal behavior, it targets law-abiding behavior.”

Proponents, however, said background checks would save lives.

Jennifer Crowe, a spokeswoman for the pro-initiative campaign in Nevada, previously told Reuters nearly one in 11 people in that state who purchased guns online would have failed a background check.

Everytown for Gun Safety, the gun control group founded by billionaire former New York City Mayor Michael Bloomberg, spent tens of millions of dollars in Washington state, Nevada and Maine, while the National Rifle Association focused much of its spending on supporting Republican presidential nominee Donald Trump.