WASHINGTON (AP) — The Supreme Court on Friday struck down a Trump-era ban on bump stocks, a gun accessory that allows semi-automatic weapons to fire rapidly like machine guns and was used in the deadliest mass shooting in modern U.S. history.

The high court found 6-3 the Trump administration did not follow federal law when it reversed course and banned bump stocks after a gunman in Las Vegas attacked a country music festival with assault rifles in 2017. He fired more than 1,000 rounds in the crowd in 11 minutes, leaving 60 people dead and injuring hundreds more.

A Texas gun shop owner challenged the ban, arguing the Justice Department wrongly classified the accessories as illegal machine guns.

The Biden administration said that the Bureau of Alcohol, Tobacco, Firearms and Explosives made the right choice for the accessories that can allow weapons to fire at a rate of hundreds of rounds a minute.

It marked the latest gun case to come before high court, where a conservative supermajority handed down a landmark decision expanding gun rights in 2022 and is also 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 semi-automatic 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 like 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 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.