SANTA FE — New Mexico’s attorney general says law enforcement agencies must enforce a new law expanding background checks to nearly all private gun sales and that they could be liable for damage claims if they don’t.

Attorney General Hector Balderas issued the warning in a letter sent Thursday to police chiefs and county sheriffs, the Albuquerque Journal reported. The law will take effect July 1.

Numerous county sheriffs opposed the legislation when it was being considered by the Democratic-led Legislature, but it was approved by lawmakers and then signed by Democratic Gov. Michelle Lujan Grisham on March 8.

Critics argued the expanded background checks and other gun control measures would be difficult to enforce and do little to address gun violence, and at least 26 county commissions approved so-called Second Amendment sanctuary ordinances in opposition.

The president of the New Mexico Sheriffs’ Association said Balderas’ letter was premature because the law hasn’t taken effect and because law enforcement officers have discretion in how they enforce laws.

“We’re elected by the people in our communities,” Cibola County Sheriff Tony Mace said of his fellow sheriffs, “and that’s what we’re looking at — what do the people in our communities want?”

The law will require a background check before nearly any gun sale, including between two individuals. There will be exceptions for sales between two close family members and between law enforcement officers.

Balderas’ two-page letter said a police chief or sheriff who refuses to enforce the law could be held liable if a gun sale results in a prohibited person obtaining a firearm and doing harm.

New Mexico’s three most populous counties — Bernalillo, Doña Ana and Santa Fe — didn’t join the movement against the bill, and Lujan Grisham last month accused the sheriffs who opposed the new law of being part of a “national misinformation campaign” driven by the National Rifle Association.

State House Republicans are trying to get the issue before voters through a rarely-used referendum process.