The US Supreme Court has lifted a ban on bump stocks, the rapid-fire gun accessory used in America’s deadliest mass shooting.

The court ruled by a 6-3 majority that the government did not have the right to ban the accessories.

The Trump administration banned bump stocks after they were used in a shooting that killed 60 people at a concert in Las Vegas in 2017.

But a Texas gun shop owner who challenged the ban said the government went too far in defining the accessories as machine guns, which are mostly illegal under federal law – with some exceptions – and took his fight all the way to America’s highest court.

US law prohibits the transfer or possession of machine guns made after 19 May 1986, the effective prohibition date. However, transfer or possession of machine guns lawfully obtained before that date is legal.

The court said a semi-automatic rifle with an attachment does not qualify as a machine gun under federal law.

The Supreme Court’s opinion, written by conservative Justice Clarence Thomas, said the Bureau of Alcohol, Tobacco, Firearms and Explosives had “exceeded” its authority.

The court, quoting part of the legal definition of machine guns, said rifles with a bump stock “cannot fire more than one shot ‘by a single function of the trigger’, and even if they could, they would not do so ‘automatically'”.

The split decision saw the three liberal justices on the conservative-dominated, nine-member court dissent: Justices Ketanji Brown Jackson, Elena Kagan and Sonia Sotomayor.

Justice Sotomayor said: “Today, the Court puts bump stocks back in civilian hands.”

A decision which she said “will have deadly consequences”.

On whether weapons with the accessory should qualify as machine guns, she said: “When I see a bird that walks like a duck, swims like a duck, and quacks like a duck, I call that bird a duck.”

In the 1986 Firearms Act, machine guns are defined as any “weapon which shoots, is designed to shoot, or can be readily restored to shoot, automatically more than one shot without manual reloading, by a single function of the trigger”.

During a hearing on the case in March, some justices on the conservative-led court appeared sceptical of the ban, drawing attention to the minor technical differences of how a bump-stock gun fires compared to a machine gun.

At the time, Justice Neil Gorsuch said he could understand “why these items should be made illegal”, but said that doing so explicitly was Congress’s role.

Justice Ketanji Brown Jackson countered, saying bump stocks are just “the kinds of weapons Congress was intending to bar because of the damage they do”.

The bump stock harnesses a rifle’s recoil to rapidly fire multiple rounds. It replaces the weapon’s stock, which is held against the shoulder, and allows the gun to slide back and forward between the user’s shoulder and trigger finger. That motion – or bump – lets the gun fire without the user having to move their finger.

The attacker in the Las Vegas shooting had attached bump stocks to 12 of his semi-automatic rifles which allowed him to fire hundreds of rounds per minute, the same rate as many machine guns. He killed 60 people and wounded hundreds more who had gathered for a music festival.

A spokeswomen for Donald Trump’s campaign, whose administration enacted the original ban, told the BBC that “the court has spoken and their decision should be respected”.

A spokesman for President Joe Biden, who is scheduled to debate Trump on 27 June as the two candidates bid for re-election, criticised the decision. “Weapons of war have no place on the streets of America,” they said.