Last month, the National Rifle Association rallied its members against a new California regulation compelling gun and ammo buyers who lack the state’s new REAL ID to present a birth certificate or a passport when going through a background check. In many ways, it’s a typical story of NRA opposition to gun rules — except that the gun group prompted the reform in the first place.

The new regulation, which went into effect July 1 alongside a new background check requirement for all ammunition purchases, was part of a state attempt to close a potential loophole for some buyers.

Gun buyers have to present an ID for a background check, typically a driver’s license. But background check databases may lack complete records for certain purchasers. For instance, federal law prohibits gun sales to undocumented immigrants, but there may be no record in the background check system that a person came to the country illegally. Approximately 11 million undocumented people reside in the country, but the FBI only has records of 8.4 million in the background check system. Also, California provides driver’s licenses to undocumented immigrants. As a result, a gun dealer in the state could conceivably make an illegal sale to an undocumented immigrant who passed a check.

Since 2018, the state has also issued a so-called REAL ID, which complies with more stringent federal security standards and affirms that the holder is a legal resident. Last year, the NRA asked the federal Bureau of Alcohol, Tobacco, Firearms and Explosives for clarity on what dealers should do when a customer presents an older ID. The ATF said that dealers in the state could still make the sale, but may want to ask for additional documentation like a passport or birth certificate if a customer uses an older ID.

In June, California’s Department of Justice said the snafu identified by the NRA had resulted in “widespread confusion” and could cause “significant public harm” if prohibited purchasers could buy guns. As a remedy, the state announced it was imposing a rule that California gun owners who lack REAL ID would be required to bring other documents to the gun store. In an ironic twist, the California DOJ explicitly cited the gun group’s question and the ATF’s response as the only two documents upon which it based the regulation.

The day after the DOJ issued the regulation, the gun group urged members to submit comments opposing it. The NRA told members the DOJ’s regulation was an attempt to “overrule” the ATF’s determination that older ID was still legally acceptable for background checks — neglecting to mention that the agency had suggested that dealers adopt exactly the standards that California now requires.