Christian Pulisic scored the winner against Iran that sent the United States through to face the Netherlands in the World Cup last 16.
The Chelsea forward turned AC Milan defender Sergino Dest’s header over the line seven minutes before half-time.
But he collided with Iran goalkeeper Alireza Beiranvand in the process and needed several minutes of treatment – before being replaced at the break.
It was a match with lots at stake as both teams had a chance to seal a place in the knockout stages.
But Iran, who would have gone through with a draw, could not muster a shot on target as they were knocked out.
In the second half, they came close – Brentford’s Saman Ghoddos came off the bench to strike inches over the bar when he was unmarked in the box, before Saeid Ezatolahi also curled over.
Perhaps their best chance came deep in stoppage time, when Morteza Pouraliganji met a free-kick with a diving header that went just wide.
And there was still time for controversy as Mehdi Taremi appealed for a penalty as he went down with Cameron Carter-Vickers trying to stop him, but their penalty appeals were rejected.
In the end, Iran exited the World Cup with a sense of disappointment as the USA made the knockout stages for the third time in four tournaments.
This was a meeting between two nations with a difficult relationship.
They cut diplomatic relations in 1980, and their World Cup encounter was played amid a backdrop of widespread anti-government protests in Iran.
Iran has accused the US and other foreign adversaries of instigating the protests. The US government, meanwhile, has imposed sanctions on Iranian officials over a crackdown that has followed.
Those protests were sparked by the death in custody in September of Mahsa Amini, a 22-year-old woman who was detained by morality police for allegedly breaking the strict rules around head coverings.
Earlier this week, USA manager Gregg Berhalter apologised after a modified version of Iran’s flag was used in social media posts by the US national team.
The US said they decided not to use Iran’s official flag in the social media posts to show “support for the women in Iran fighting for basic human rights”.