Iran's state media showed video on Saturday of the successful test-launch, saying the missile had a range of 2000km. "They are also working with North Korea", Trump said on Twitter. He also linked the action to recent aggressive moves by North Korea.
Trump put Iran "on notice" in February for test-firing a ballistic missile and imposed new economic sanctions in July over its missile program and "malign activities" in the Middle East.
Iran's armed forces staged military parades on Friday to mark the start of the Week of Defense, commemorating Iranian sacrifices during the eight-year Iraq-Iran war in the 1980s.
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 United States warnings and demands.
Iran said on Saturday that it had successfully tested a new medium-range missile in defiance of warnings from the U.S. that it was ready to ditch a landmark nuclear deal over the issue.
US President Donald Trump gave a stark warning to Iran on Saturday, casting growing uncertainty over whether a nuclear deal clinched with the Islamic republic would survive after it tested a new medium-range missile.
On Thursday, Iran's Supreme Leader Ayatollah Ali Khamenei, who has final say on all major policies in Iran, said Trump's "cheap, ugly, foolish and unreal" remarks before the U.N. General Assembly were a sign of desperation.
Britain voiced concerns about the latest test.
"On the one hand Iran is trying to demonstrate they are the pragmatic rational actor here and maintain unity among the other signatories of the nuclear agreement, even if from the U.S. side it starts to unravel", Vakil told CNN.
"The regime has engaged in such launches repeatedly, including in July of this year when it launched a rocket into space that intelligence experts say can be used to develop intercontinental ballistic missile technology", Haley said in a speech at the American Enterprise Institute on September 5.
"This is the third Iranian missile with a range of 2,000 km", it added.
"We will develop our defensive and military power as much as necessary., and to this end Iran seeks no permission from anybody", he said.
"Extremely concerned by reports of Iran missile test, which is inconsistent with United Nations resolution 2231".
"The weight of the Khorramshahr missile's warhead has been announced to be 1,800 kg (4,000 lbs), ... making it Iran's most powerful missile for defence and retaliation against any aggressive enemy", state television said.