Russian-made Sam-6 surface-to-air missiles are seen in front of a portrait of Iran's Supreme Leader Ayatollah Ali Khamenei

A top adviser to the Iranian supreme leader said the country will not yield to 'useless' US threats from 'an inexperienced person' over its ballistic missile programme.

Donald Trump said it was putting Iran 'on notice' over its 'destabilising activity' after it test-fired a cruise missile.

But Ali Akbar Velayati said, who is a senior counsel to Iran's most powerful man Ayatollah Ali Khamenei hit back.

'This is not the first time that an inexperienced person has threatened Iran,' he said.

'The American government will understand that threatening Iran is useless.'

Trump's national security adviser, Michael Flynn, made the original statement attacking Iran before the POTUS echoed the message.

He said in a tweet 'Iran has been formally put on notice' after his administration said it was reviewing how to respond to the launch that Iran said was solely for defensive purposes.

Iran claimed on Wednesday it had tested the new ballistic missile but said it did not breach a nuclear deal reached with six major powers in 2015 or a UN Security Council resolution that endorsed the accord.

Velayati responded by saying: 'Iran does not need permission from any country to defend itself.'

A US official said Iran had test-launched the medium-range ballistic missile on Sunday and it exploded after travelling 630 miles (1,010 km).

Iran said it had been a successful launch.

A series of tests conducted by Iran's elite Revolutionary Guards Corps (IRGC) in 2016 caused international concern, with some powers saying any launch of nuclear-capable ballistic missiles would violate UN Security Council resolution 2231.

Scroll down for video

Iran hit back at Donald Trump's comments saying the country was being put on notice over its 'destabilising activity' after it test-fired a ballistic missile

A senior leader to Ayatollah Ali Khamenei, Iran's most powerful figure, said America's threats were useless and that Iran did not need permission to defend itself

The IRGC maintains an arsenal of dozens of short and medium-range ballistic missiles - the largest in the Middle East, according to the London-based International Institute for Strategic Studies.

Under the nuclear agreement, most UN sanctions were lifted a year ago.

But Iran is still subject to an UN arms embargo and other restrictions, which are not technically part of the deal.

Trump has frequently criticised the Iran nuclear deal, which restricts Tehran's nuclear activities in exchange for the lifting of the sanctions, calling the agreement weak and ineffective.

He tweeted on Thursday that Iran 'should have been thankful for the terrible deal the US made with them'.

Iran's Defence Minister Hossein Dehghan told the semi-official Tasnim news agency on Thursday: 'The missile test on Sunday was successful.

'The test was not a violation of a nuclear deal with world powers or any UN resolution.'

German newspaper Die Welt, citing unspecified intelligence sources, reported on Thursday that Iran had tested a home-made cruise missile called 'Sumar' that is capable of carrying nuclear weapons.

Tasnim news agency two years ago published pictures of the Sumar missile, reporting that it was successfully test-fired.

While Iran says its missile programme is aimed at displaying the country's 'deterrent power and its ability to confront any threat', some IRGC commanders have said that Iran's medium-range ballistic missiles were designed to be able to hit Israel.