As Republicans continue to chip away at Barack Obama’s legislative legacy, House G.O.P. members on Thursday took aim at a regulation designed to make it more difficult for people with certain mental illnesses to obtain firearms.

Galvanized by their new ally in the Oval Office, Republican lawmakers overturned a rule adopted in December that would have required the Social Security Administration to provide information about beneficiaries with severe mental disorders to the F.B.I. background check system. “There is no evidence suggesting that those receiving disability benefits from the Social Security Administration are a threat to public safety,” Bob Goodlatte, Virginia congressman and chairman of the House Judiciary Committee, said of the regulation. “Once an unelected bureaucrat unfairly adds these folks to the federal background check system, they are no longer able to exercise their Second Amendment right.”

Democratic proponents of the regulation pushed back, arguing that the restriction is specifically, and carefully, targeted. “These are not people just having a bad day,” Mike Thompson, a Democratic congressman from California, said. “These are not people simply suffering from depression or anxiety or agoraphobia. These are people with a severe mental illness who can't hold any kind of job or make any decisions about their affairs, so the law says very clearly they shouldn't have a firearm.”

With a 235-180 vote along party lines, the House scrapped the rule through an obscure law called the Congressional Review Act, which allows either house of Congress to invalidate a rule during a short time window with a simple majority vote. “The House charged ahead with an extreme, hastily written, one-sided measure that would make the American people less safe,” Democratic congresswoman Elizabeth Esty of California said. NPR reports that an estimated 75,000 beneficiaries would have been impacted by the regulation. According to Politico, the affected group would have been alerted about “their possible federal prohibition on possessing or receiving firearms, the consequences of such prohibition, the criminal penalties for violating the Gun Control Act, and the availability of relief from the prohibition.”

The National Rifle Association applauded the Republican vote to rescind the rule. “The Obama administration’s last minute, back-door gun grab would have stripped law-abiding Americans of their Second Amendment rights without due process,” Chris Cox, executive director of the N.R.A.'s Institute for Legislative Action, told Politico. “Today’s vote was the first step in revoking this unconstitutional action.”

The American Civil Liberties and a number of mental-health advocacy groups also supported the vote to overturn the rule, taking issue with the standard used to determine who would be affected by the regulation and arguing that it was discriminatory. “It advances and reinforces the harmful stereotype that people with mental disabilities, a vast and diverse group of citizens, are violent,” Faiz Shakir, the director of the Washington Legislative Office of the American Civil Liberties Union, wrote in a statement. “There is no data to support a connection between the need for a representative payee to manage one’s Social Security disability benefits and a propensity toward gun violence.”