Iran's Islamic Revolution Guard Corps (IRGC) says it has successfully launched a military satellite into orbit for the first time.
The satellite, named Nur (Light), reached an orbit of 425km (264 miles) after being carried by a three-stage Qased launcher, a statement said.
The success of the launch has not been verified independently.
But US Secretary of State Mike Pompeo said Iran had violated a UN resolution and needed "to be held accountable".
He spoke shortly after President Donald Trump tweeted that he had instructed the US Navy to "shoot down and destroy any and all Iranian gunboats if they harass our ships at sea".
Mr Trump appeared to be referring to an incident in the Gulf a week ago, in which the US said 11 IRGC Navy vessels repeatedly conducted "harassing" approaches of six US Navy and Coast Guard ships.
Iran accused the US of giving a "Hollywood version of events" and said the US Navy had blocked the path of an Iranian ship earlier this month.
A spokesman for the Iranian armed forces criticised Mr Trump's tweet, saying that "instead of bullying others" the US should focus on "saving the contingent of their [armed] forces that has been infected with coronavirus".
The countries came close to war in January, when the US killed a top IRGC general in a drone strike in Iraq. Iran responded by launching ballistic missiles at Iraqi military bases hosting US forces.
What did Iran say about the satellite launch?
The IRGC said it took place in the remote Central Desert on Wednesday.
Footage broadcast by state TV showed the Qased carrier inscribed with a verse from the Koran that Muslims often recite when going on a journey: "Glory be to Him, who has subjected this to us, and we ourselves were not equal to it."
IRGC's commander-in-chief, Maj-Gen Hossein Salami, said the force had taken "a major step in promoting the scope of [its] strategic information capabilities".
"Today, we are looking at the Earth from the sky, and it is the beginning of the formation of a world power," he was quoted by Fars news agency as saying.
IRGC Aerospace Force commander Brig-Gen Amir-Ali Hajizadeh said the Qased "used a compound of liquid and solid propellants" and declared: "Only superpowers have such capability".
Iranian Telecommunications Minister Mohammad Javad Azari Jahromi congratulated the IRGC on the "great national achievement" and stressed that the Aerospace Force's space programme was defensive.
"Part of Iran's peaceful [space] programme is civilian which is pursued by the government, while another part is for peaceful defence purposes and naturally carried out by the armed forces," he tweeted.
In February, Iran failed to put into orbit the Zafar communications satellite.
There were two other failed satellite launches last year, as well as a mysterious explosion that destroyed a satellite launch vehicle.
Why is the US concerned?
The Trump administration has warned that the technology used to launch satellites could help Iran develop intercontinental ballistic missiles (ICBMs).
It has asserted that such launches therefore violate a UN Security Council resolution, which calls upon on Iran not to "undertake any activity related to ballistic missiles designed to be capable of delivering nuclear weapons".
Iran has denied violating the resolution and insisted that its space programme is entirely peaceful and that it has no intention to develop nuclear weapons.
The same resolution endorsed a 2015 nuclear deal between Iran and world powers that President Trump abandoned two years ago. He said it was flawed and demanded it be replaced with one that halted the Iranian ballistic missile programme.
How did it react on Wednesday?
Secretary of State Pompeo said every nation had "an obligation to go to the United Nations and evaluate whether this missile launch was consistent with that Security Council resolution".
"I don't think it remotely is. And I need I think Iran needs to be held accountable for what they've done," he told reporters in Washington. "They've now had a military organisation that the United States has designated a terrorist [organization] attempt to launch a satellite."
Mr Pompeo also said President Trump's order to fire on Iranian gunboats harassing US ships made it clear that the navy should take whatever action was needed to defend American lives and assets.
Senior US military officials called it an important warning and a "very useful thing", but did not indicate that it was a change of military policy on Iran.