The Trump administration on Tuesday imposed a ban on bump stocks, the rapid-fire attachment used to carry out the worst mass shooting in modern U.S. history.

Now comes a bigger challenge: How to deal with more than a half-million bump stocks Americans have purchased over the past eight years alone.

Justice Department officials, who issued the ban Tuesday, said owners of the cheap plastic accessories that can make off-the-shelf semiautomatic rifles fire almost as rapidly as a machine gun will have 90 days to either turn them over to federal agents or to melt, shred or crush them. Those who don't face the threat of criminal penalties.

Both gun owners and advocates of tougher restrictions questioned its effectiveness. Because officials had long taken the view that the stocks weren't covered by federal gun laws, their sales weren't tracked and the government has no way to determine who owns one.

Some states and cities acted more swiftly to ban the devices on their own, but they've had little success getting people to surrender them. In Massachusetts, the first state to impose a ban, only a handful of the devices have been surrendered to state police. In Denver, where a citywide ban passed in January carrying a fine and jail time, police reported zero surrenders.

“Compliance will be impossible because there’s no registration," said Mark Pennak, president of the gun rights group Maryland Shall Issue. “And based on how the state bans have been received, I doubt there will be any compliance. It will be haphazard and discriminatory."

Bump stocks had been under scrutiny since a gunman killed 58 people and injured more than 800 from his perch in a Las Vegas casino in 2017, the deadliest mass shooting in recent memory. The devices allowed the gunman, Stephen Paddock, to fire more than 1,100 rounds of ammunition in 10 minutes. Bump stocks were affixed to half of Paddock's guns.

The Justice Department had long taken the view that bump stocks fell outside federal laws banning machine guns. It reversed that position Tuesday after months of pressure from President Donald Trump and others in the aftermath of the Las Vegas shooting.

"As written, this case has important implications for gun owners since, in the coming days, an estimated half a million bump stock owners will have the difficult decision of either destroying or surrendering their valuable property, or else risk felony prosecution," said Erich Pratt, executive director of Gun Owners of America.

He said the group planned to challenge the ban in court. Another gun rights group, the Firearms Policy Coalition, filed a lawsuit Tuesday to block the rule in federal court in Washington.

The national ban comes with no "grandfather" clause to allow previously produced devices and doesn't provide any financial reimbursement or tax credit.

The main manufacturer of one brand in Texas stopped producing the device over the summer in anticipation of the ban. Another Texas company purchased that producer's inventory and was still selling devices for $199 Tuesday, including within a Christmas promotion guaranteeing delivery if ordered by Thursday.

More:A year after Vegas shooting, ATF emails reveal blame, alarm over bump stocks

More:President Trump vows bump stocks will be 'gone' in a matter of weeks

Bump stocks combined two legal devices, a plastic stock and a firearm, that together function like a machine gun. The bump stock harnesses the recoil of the rifle to accelerate trigger pulls, technically “bumping” the trigger for each shot after it bounces off the shooter’s shoulder. After the Las Vegas shooting in October 2017, the Justice Department reconsidered its determination that the device was legal. In 2003, 2010, 2012 and 2013, the department ruled the $200 devices were legal.

More:Hundreds of gun add-ons test limits of ATF review

“Consistent with its authority to ‘reconsider and rectify’ potential classification errors … ATF reviewed its earlier determinations for bump-stock-type devices issued between 2008 and 2017 and concluded that those determinations did not include extensive legal analysis of the statutory term ‘automatically’ or ‘single function of the trigger,’ " the Justice Department wrote.

The move was widely expected. Trump announced at the one-year anniversary of the Las Vegas shooting that “we’re knocking out bump stocks." Internal emails show officials at the Bureau of Alcohol, Tobacco, Firearms and Explosives, the agency that regulates guns, struggled with how to block a product its staff had long concluded was legal. The Trump administration concluded that a regulatory rule was simpler than negotiating with Congress to rewrite gun laws.

Kris Brown, president of the Brady Campaign, a group that favors stricter gun laws, applauded the change but said she fears it could be vulnerable to legal challenges.

“The only way to ensure that bump stocks and similar devices are properly regulated is for Congress to take action,” she said. "We will continue to call on congressional leaders to do just that."

Eleven states – California, Connecticut, Delaware, Florida, Hawaii, Maryland, Massachusetts, New Jersey, Rhode Island, Vermont and Washington – have banned bump stocks. More than a dozen cities and other states are considering bans.