The assassination by the US of Iran's most powerful general caused tensions between the two countries to soar, raising fears of an all-out war.
But what lies at the root of the crisis? Here are the basics.
Iranians take part in an anti-US rally to protest the killings during a US air strike of Iranian military commander Qasem Soleimani and Iraqi paramilitary chief Abu Mahdi al-Muhandis on 4 January.
The US and Iran have long been foes.
Problems can be traced to at least 1979, when Iran's US-backed shah was overthrown and the country became an Islamic republic.
That year, amidst the fallout from the revolution, dozens of Americans were taken hostage inside the US embassy in the capital Tehran. Relations have been frosty ever since.
There were signs of a diplomatic thaw in 2015, when Iran agreed a landmark deal to limit its nuclear programme, allaying international concerns. It did so in return for the lifting of tough economic sanctions.
But the election of US President Donald Trump the following year posed a challenge. He hated the nuclear accord, which he branded "the worst deal ever negotiated".
In 2018, he abandoned it altogether and reinstated US sanctions to force Iran's leaders to agree to a new deal - something they rejected, even as the Iranian economy was sent into a deep recession.
Trump stepped up the pressure in May 2019 by applying secondary sanctions on countries that continued to do business with Iran.
Relations further deteriorated when six oil tankers were sabotaged in the Gulf of Oman in May and June. Washington accused Iran of being behind these attacks. Iran denied this.
In July, Tehran started suspending some of the commitments it had made under the nuclear deal.
Then, in late December, the US blamed an Iranian-backed militia for a rocket attack which killed an American contractor in northern Iraq.
Washington retaliated by bombing bases associated with the militia in Iraq and Syria, killing at least 25 fighters.
These bombings sparked a backlash in Iraq. The US embassy in the capital, Baghdad, was attacked by crowds of protesters.
Trump blamed Iran for orchestrating the attack and warned it would "pay a very big price".
On 3 January, Qassem Soleimani was killed in a US drone strike at Baghdad airport.
The general - who controlled Iran's proxy forces across the Middle East - was regarded as a terrorist by the Americans, who alleged he was responsible for the deaths of hundreds of American troops and was plotting "imminent" attacks.
Iran vowed "severe revenge" for his death and said two days later that it had abandoned the last limit on its enrichment of uranium imposed by the nuclear deal.
Trump, meanwhile, warned the US would respond in the event of retaliation "perhaps in a disproportionate manner".