Iran's supreme leader has threatened to "shred to pieces" the nuclear deal if the US withdraws from the pact, just days after Donald Trump signalled Washington was turning its back on the 2015 agreement.

Ayatollah Ali Khamenei dismissed the US President's rejection of the deal as the "rants and whoppers" of a "brute", and said the White House should refrain from "bullying".

In a speech on state TV, he said Tehran would stick to the agreement, but only as long as the six signatories – the US, UK, Russia, France, China, and Germany – respected the deal.

Ayatollah Khamenei added that Mr Trump's description of the deal as leading to "more violence, more chaos" was "nonsensical" and the result of a "foul-mouthed president".

His comments followed Mr Trump's announcement on Friday that he would not re-certify the landmark deal, which saw Iran suspend elements of its nuclear energy programme in exchange for a relaxation of sanctions.

The remaining parties to the accord insist Washington cannot unilaterally cancel a multinational deal enshrined by a UN resolution.

Ayatollah Khamenei welcomed their backing but warned it would not be enough to save the agreement.

"Europe must stand against practical measures [taken] by America," he said. If Mr Trump ditched the deal, "Iran will shred it".

The Supreme Leader, Iran's highest authority, also said Tehran would continue its controversial ballistic missile programme despite pressure from Europe and the US to suspend it.

Iran tests new medium-range missile despite Trump warnings

Tehran has defended the move, saying the weapons are solely for defensive purposes.

"They must avoid interfering in our defence programme," Ayatollah Khamenei said. "They [Europeans] ask why does Iran have missiles? Why do you have missiles yourselves? Why do you have nuclear weapons? We do not think it is acceptable for the Europeans to join America in its bullying."

He added: "They [the US] are angry as today the Islamic republic of Iran has disrupted their plans in Lebanon, Syria and Iraq.

"Everyone be assured that this time, too, America will be slapped and defeated by the nation of Iran."

Mr Trump's decision not to certify that Tehran was complying with the deal was quickly rebuffed by Iran's President, Hassan Rouhani, who said on Friday that Mr Trump's speech was full of "insults and fake accusations".