Trump signed off on a waiver Friday to keep several sanctions on Iran suspended, essentially keeping the nuclear deal in effect.

The US President must sign such waivers every few months under the Joint Comprehensive Plan of Action (JCPOA), an agreement brokered in 2015 that obliges Iran to restrict its nuclear program in exchange for the easing of sanctions.

Iranian President Hassan Rouhani speaking in Tehran, on December 31, 2017.

"It's been one year since Trump has been trying to kill JCPOA and hasn't been successful. This means victory of law over dictatorship," Rouhani said Sunday, slamming the US for what he said were its attempts at "self-aggrandizing."

Read More

State news agency IRNA reported him saying that Iran had proved it was right "and our enemies were wrong."

"I am very happy to see that the White House has failed to disrupt international obligations, break loyalty and stand against the resolution of the United Nations Security Council which was the outcome of an agreement among seven countries," he said.

Rouhani's remarks were the latest in a tit-for-tat exchange between Trump and Iranian officials over the deal, as well as anti-government protests that took place across the country recently. Trump openly supported the protesters, who staged the biggest challenge to the Iranian regime since 2009. The US State Department also openly encouraged Iranians to protest.

Iranian students protest at the University of Tehran during a demonstration driven by anger over economic problems on December 30.

Many of the new US sanctions on Iran were in response to the government's crackdown on the largely peaceful protests. Others were linked to support for the country's ballistic missile program, which falls outside the scope of the nuclear deal.

In a bizarre kicker in the waiver announcement, the US indicated it hoped to rewrite much of the nuclear agreement and to get its European allies, who wholly back the deal as it is, to do the bargaining for it. European foreign ministers on Thursday urged Trump to sign the waiver and support the deal.

The 2015 agreement was brokered by the Obama administration, along with the UK, Russia, France, Germany and China.

Trump -- who during the election campaign described the Iran pact as "the worst deal ever" -- is under pressure to make good on more of his pre-election promises. But he is also under immense pressure by European powers who helped brokered the deal to preserve it. According to US officials who spoke to CNN, Trump's own senior security advisers also urged the President to sign off on the waivers and not to kill off the agreement.

The new US sanctions on Iran are a way for Trump to keep pressure on Iran without jeopardizing the nuclear deal.

They are also the first concrete international response to the Iranian government's treatment of protesters.

Roughly 3,700 people were arrested during the rallies, one of the country's lawmakers said Tuesday. Other Iranian authorities had previously said 450 people were detained.