WASHINGTON (AP) — The Supreme Court on Friday struck down a Trump-era ban on bump stocks, a rapid-fire gun accessory that was used in the deadliest mass shooting in modern U.S. history.

The high court’s conservative majority found that the Trump administration did not follow federal law when it changed course from previous administrations after a gunman in Las Vegas attacked a country music festival with assault rifles equipped with bump stocks, which allow a rate of fire comparable to machine guns.

The gunman fired more than 1,000 rounds in the crowd in 11 minutes, sending thousands of people fleeing in terror as hundreds were wounded and dozens were killed in 2017.

The 6-3 majority opinion written by Justice Clarence Thomas said a semiautomatic rifle with a bump stock is not an illegal machine gun because it doesn’t make the weapon fire more than one shot with one pull of the trigger.

“A bump stock does not alter the basic mechanics of bump firing, and the trigger still must be released and reengaged to fire each additional shot,” he wrote in an opinion that contained multiple drawings of guns’ firing mechanisms.

He was joined by his fellow conservatives. Justice Samuel Alito wrote a short separate opinion to stress that Congress can change the law to equate bump stocks with machine guns.

Changing the definition of a bump stock through regulation rather than legislation took pressure off Republicans in Congress to act or justify inaction in the face of the Las Vegas massacre during Trump’s presidency.

In a dissent joined by her liberal colleagues, Justice Sonia Sotomayor pointed to the Las Vegas gunman. “In murdering so many people so quickly, he did not rely on a quick trigger finger. Instead, he relied on bump stocks,” she said, reading a summary of her dissent aloud in the courtroom. Sotomayor said that it’s “deeply regrettable” Congress has to act but that she hopes it does.

Former President Donald Trump’s 2024 campaign team said it respects the court’s decision in a statement that quickly pivoted to politics, touting his endorsement by the National Rifle Association. President Joe Biden did not have an immediate comment.

U.S. Rep. Andrew Clyde, a Republican from Athens and a gun store owner, said he was happy with the court’s decision.

But he also said it demonstrated a need for the REINS Act, legislation Kentucky U.S. Sen. Ran Paul proposed that would require Congress to approve major rules created by agencies in the executive branch before they take effect.

“You have an executive agency, the (Bureau of Alcohol, Tobacco, Firearms and Explosives), made a rule. It took seven years to overturn that rule through the court system. Seven years where our constitutional rights were infringed upon,” Clyde said. “That’s wrong.”

The Biden administration said that the ATF made the right choice for the gun accessories, which can allow weapons to fire at a rate of hundreds of rounds a minute.

U.S. Rep. Hank Johnson, D-Lithonia, criticized Thomas’ decision in a post on social media, saying it “appeases wealthy firearms patrons.”

“His edict opens the door wide for the sale of bump stocks, which enables mass killings w/ more efficiency,” Johnson wrote.

The high court’s decision came after a Texas gun shop owner challenged the ban, arguing the Justice Department wrongly classified the accessories as illegal machine guns.

It marked the latest gun case to come before the high court. A conservative supermajority handed down a landmark decision expanding gun rights in 2022 and is weighing another gun case challenging a federal law intended to keep guns away from people under domestic violence restraining orders.

The arguments in the bump stock case, though, were more about whether the ATF had overstepped its authority than the Second Amendment.

Justices from the court’s liberal wing suggested it was “common sense” that anything capable of unleashing a “torrent of bullets” was a machine gun under federal law. Conservative justices, though, raised questions about why Congress had not acted to ban bump stocks, as well as the effects of the ATF changing its mind a decade after declaring the accessories legal.

The high court took up the case after a split among lower courts over bump stocks, which were invented in the early 2000s. Under Republican President George W. Bush and Democrat Barack Obama, the ATF decided that bump stocks didn’t transform semiautomatic weapons into machine guns. The agency reversed those decisions at Trump’s urging after the shooting in Las Vegas and another mass shooting at a Parkland, Florida, high school that left 17 dead.

Bump stocks are accessories that replace a rifle’s stock, the part that rests against the shoulder. They harness the gun’s recoil energy so that the trigger bumps against the shooter’s stationary finger, allowing the gun to fire at a rate comparable to a traditional machine gun. Fifteen states and the District of Columbia have their own bans on bump stocks.

The plaintiff, Texas gun shop owner and military veteran Michael Cargill, was represented by the New Civil Liberties Alliance, a group funded by conservative donors such as the Koch network. His attorneys acknowledged that bump stocks allow for rapid fire but argued that they are different because the shooter has to put in more effort to keep the gun firing.

Government lawyers countered the effort required from the shooter is small and doesn’t make a legal difference. The Justice Department said the ATF changed its mind on bump stocks after doing a more in-depth examination spurred by the Las Vegas shooting and came to the right conclusion.

There were about 520,000 bump stocks in circulation when the ban went into effect in 2019, requiring people to either surrender or destroy them, at a combined estimated loss of $100 million, the plaintiffs said in court documents.

Atlanta Journal-Constitution columnist Jamie Dupree contributed to this article.