Iran has "successfully" tested a new ballistic missile that can carry multiple warheads and can travel up to 2,000km, according to state media.

The news of the test comes just hours after Iran's Revolutionary Guard unveiled the missile during a military parade in Tehran.

The move was a direct challenge to US President Donald Trump, who in August signed a bill imposing mandatory penalties on those involved in Iran's ballistic missile programme and anyone who does business with those involved in the programme.

READ MORE - Iran's Khamenei - Tehran will not bow to US bullying

Though Iran has long boasted of having missiles in the same range in its arsenal, it was the first time that the Khorramshahr missile was displayed in public.

Trump has vowed repeatedly to take a tougher line towards Iran, threatening at various time to renegotiate or dismantle the 2015 nuclear deal, and shoot Iranian boats out of the water if they provoke US naval vessels.

'Boost military capabilities'

Iranian President Hassan Rouhani addressed Friday's parade in Tehran, saying that Iran would not halt its missile programme and would continue to boost military capabilities, despite US warnings and demands.

"We will strengthen our defence and military capabilities ... whether you want it or not," Rouhani said, a direct response to Trump's speech at the UN General Assembly this week.

Rouhani has said that the Trump administration is seeking "an excuse" to pull out of the landmark 2015 nuclear agreement that capped Iran's nuclear activities in return for the lifting of international sanctions on Iran.

The deal between Iran and world powers does not strictly prohibit Iran from developing missiles, but after the agreement came into effect last year, the UN Security Council adopted a resolution calling on Iran not to take any actions related to ballistic missiles "designed to be capable of delivering nuclear weapons" for eight years.

Tehran has argued that the tests are solely for defensive purposes and notes the Security Council measure only applies to missiles specifically designed to carry nuclear warheads.

READ MORE: UN nuclear watchdog defends Iran agreement

In February, Iran test-fired the same medium-range type of missile, prompting Trump to say that the United States is "putting Iran on notice".

The report of the test, shown late on Friday on state television, did not mention the time or location of the test.