General Qasem Soleimani, the head of the Iranian Revolutionary Guards' elite Quds Force, has been killed by US forces in Iraq.
The Pentagon confirmed he was killed "at the direction of the president".
Gen Soleimani was being driven by car at Baghdad airport, alongside local Iran-backed militias, when he was hit by a US air strike.
Iran's Supreme Leader Ayatollah Ali Khamenei said "severe revenge awaits the criminals" behind the attack.
He also announced three days of mourning.
Gen Soleimani was a major figure in the Iranian regime. His Quds Force reported directly to Ayatollah Ali Khamenei and he was hailed as a heroic national figure.
But the US has called the commander and the Quds Force terrorists, and holds them responsible for the deaths of hundreds of US personnel.
US President Donald Trump tweeted an image of the American flag after the news broke.
Global oil prices meanwhile soared more than 4% in the wake of the strike.
What happened?
US media reports say Gen Soleimani and officials from Iran-backed militias were leaving Baghdad airport in two cars when they were hit by a US drone strike near a cargo area.
The commander had reportedly flown in from Lebanon or Syria. Several missiles reportedly struck the convoy, and at least five people are thought to have died.
Iran's Revolutionary Guards said Iraqi militia leader Abu Mahdi al-Muhandis was among those killed.
A Pentagon statement said: "At the direction of the President, the US military has taken decisive defensive action to protect US personnel abroad by killing Qasem Soleimani."
It added: "This strike was aimed at deterring future Iranian attack plans. The United States will continue to take all necessary action to protect our people and our interests wherever they are around the world."
The drone strike comes days after protesters attacked the US embassy in Baghdad, clashing with US forces at the scene. The Pentagon said Gen Soleimani approved the attacks on the embassy.