President Donald Trump announced Friday the United States is pulling out of the international Arms Trade Treaty, a treaty signed by the Obama administration—but never ratified by the Senate—that concerned many Second Amendment advocates.

Trump called it a “badly misguided” treaty when speaking Friday at the National Rifle Association’s annual meeting in Indianapolis.

“We will never allow foreign bureaucrats to trample on your Second Amendment freedoms,” the president said. “We will never ratify the U.N. Arms Trade Treaty. I hope you’re happy.”

The announcement brought a standing ovation, surprising the president a little.

“I’m impressed. I didn’t know too many of you would know what that is,” Trump said. “America is rejecting this treaty.”

Trump signed, in front of the crowd, a message asking the Senate to discontinue any further ratification efforts “and return the now-rejected treaty back to me in the Oval Office, where I will dispose of it.”

That prompted another standing ovation and chants of “USA! USA!”

Second Amendment advocates were concerned the treaty could provide an international law rationalization for a national gun registry in the United States, and say it was overly vague.

That still leaves 101 countries that have ratified the treaty. Thirty-four countries—including the United States—signed but did not ratify it.

The stated purpose of the treaty was to regulate trade in conventional arms to stop illicit diversion by requiring member nations to file reports measuring the country’s imports and exports of small arms. However, dictatorships such as China, Iran, and Syria are not signatories.

The agreement, signed in 2015 by then-Secretary of State John Kerry on behalf of the Obama administration, was deeply controversial, as a bipartisan coalition of 57 senators opposed the treaty.  

Not everyone was pleased by the president’s decision to scrap the agreement.

“It is a treaty supported by our allies, but in opposing it, the president instead chose to stand with countries such as North Korea and Syria,” Kris Brown, president of the Brady Campaign to Prevent Gun Violence, said in a statement.

“President Trump finds it more important to feed his right-wing base than to exercise U.S. leadership on the world stage,” said Rep. Eliot Engel, D-N.Y., chairman of the House Foreign Affairs Committee. Engel said his committee would hold a hearing to review the matter.

The United States made a mistake by signing on to the treaty, and withdrawing from the overly vague agreement was a good call, said Ted Bromund, a senior research fellow at The Heritage Foundation.

Bromund said the exit of the United States from the treaty casts doubt on whether it can continue administratively since so many member nations were not paying for it.  

“The interesting question is, what is the next step for the [Arms Trade Treaty], since it has a annual budget of $1.08 million,” Bromund said. “They have a terrible budget deficit because supporters refuse to pay, unlike us. They have a $260,000 budget deficit. Now that the U.S. is dropping out, 20% more will be gone.”