President Donald Trump announced Friday that the administration would ban bump stocks and “all devices” that turn otherwise legal weapons into “illegal machine guns,” keeping a promise made amid a bipartisan gun control debate.

Moments before he departed Joint Base Andrews for his Florida property at Mar-a-Lago, and hours after signing a $1.3 trillion omnibus spending bill, the president tweeted about the new policy.

“Obama Administration legalized bump stocks. BAD IDEA. As I promised, today the Department of Justice will issue the rule banning BUMP STOCKS with a mandated comment period. We will BAN all devices that turn legal weapons into illegal machine guns,” he wrote on Friday.

A bump stock is an attachment that allows a semi-automatic rifle to achieve a fully automatic weapon’s “cyclic firing rate to mimic nearly continuous automatic fire,” according to the Bureau of Alcohol, Tobacco, Firearms and Explosives (ATF). Semi-automatic rifles with bump stocks can fire hundreds of rounds per minute, according to experts.

The bump stock moved to the foreground in the national discussion of gun control last fall, after Stephen Paddock used the attachment when he opened fire at an outdoor concert in Las Vegas. He killed 58 people and injured hundreds more.

The president, for months, has urged the Justice Department to ban firearm modifiers, directing Attorney General Jeff Sessions last month to implement new federal guidelines “very soon.”

On Friday, Sessions announced that bump stocks fall within the definition of “machine gun” under federal law, as the devices allow a semiautomatic firearms to achieve a continuous firing cycle with the single pull of the trigger.

WHAT ARE BUMP STOCKS? HOW THEY WORK AND WHY TRUMP WANTS THEM BANNED

“Since the day he took office, President Trump has had no higher priority than the safety of each and every American,” Sessions said in a statement. “That is why today the Department of Justice is publishing for public comment a proposed rulemaking that would define ‘machine gun’ to include bump stock-type devices under federal law – effectively banning them.”

Sessions cited the “senseless” Las Vegas attack, noting that the rule is a “critical step” in the effort to reduce the threat of gun violence.

The White House released a memo last month that directed the Justice Department to propose the rule.

Trump wrote in the memo, “Although the Obama administration repeatedly concluded that particular bump stock type devices were lawful to purchase and possess, I sought further clarification of the law restricting fully automatic machine guns.”

The ATF made bump stocks legal in 2010, when, at the time, the bureau concluded that bump stocks didn’t convert a semi-automatic firearm into one that is fully automatic, meaning it was not equivalent to machine guns that are regulated under the National Firearms Act, which dates back to the 1930s.

Since the shooting at a Parkland, Fla., high school last month, the president has proposed numerous measures in the gun control debate, including banning bump stocks, arming and training teachers and school officials, and raising the age requirement to purchase a gun from 18 to 21.

The president, though, has touched off tensions with the National Rifle Association, which endorsed him during the 2016 presidential campaign.

Trump has said, repeatedly, that he and the NRA “don’t have to agree on everything.”