The United States won their World Cup grudge match against Iran as Christian Pulisic scored the winner to set up a final draw with the Netherlands.
The Chelsea striker headed AC Milan defender Sergino Dest over the line seven minutes before half-time.
But he collided with Iranian goalkeeper Alireza Beiranvand in the process and needed several minutes of treatment – before being substituted at the break.
It was a match with high stakes as both teams had a chance to seal a place in the knockout stages.
But Iran, who would have qualified with a draw, only managed one shot on target as they were eliminated.
In the second half they went close – Brentford’s Saman Ghoddos came off the bench to hit inches over the bar when unmarked in the box, before Saeid Ezatolahi curled in as well.
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 fell with Cameron Carter-Vickers trying to stop him but their penalty appeals were dismissed.
In the end, Iran left the World Cup with a sense of disappointment as the United States reached the knockout stages for the third time in four tournaments.
It was a meeting between two nations with difficult relations.
They severed diplomatic relations in 1980 and their World Cup encounter came amid widespread anti-government protests in Iran.
Iran has accused the United States and other foreign adversaries of being behind the protests. The US government, meanwhile, imposed sanctions on Iranian officials for the ensuing crackdown.
These protests were sparked by the death in custody in September of Mahsa Amini, a 22-year-old woman who was arrested by vice squad for allegedly breaking strict headgear rules.
Earlier this week, US manager Gregg Berhalter apologized after a modified version of the Iranian flag has been used in social media posts by the US national team.
The United States said it decided not to use Iran’s official flag in social media posts to show “its support for women in Iran who are fighting for basic human rights.”
USA hold on to clinch Round of 16
Although it was an all-or-nothing game at Al Thumama Stadium, neither team came out of the blocks with overwhelming intensity.
Iran put some pressure on the US defense in the opening minutes but rarely caused much trouble.
Dest was energetic and direct for the United, while Pulisic’s pace and Antonee Robinson’s deliveries teased a goal for much of the first half.
When the United finally opened up the Iranian defense – Weston McKennie sprayed a perfect pass to Dest to nod for Pulisic – it only calmed them down further and they saw the first half with ease.
Celebrations from a smaller contingent of American fans behind the goal at the end were slightly muted as Pulisic received treatment after hitting the goalkeeper and he then hobbled.
Iran had nothing to lose after the break and began to err on the side of caution, creating a few chances but not really testing American keeper Matt Turner until very late.
Ghoddos, Ezatolahi and Ali Karimi gave Iranian fans a brief moment of excitement with their efforts, while Timothy Weah – who had a goal ruled out for offside in the first half – remained an outlet for the United States .
As the clock ticked, USA halted play and disrupted the pace, but Iran had one more chance to cause a major upset in stoppage time when Pouraliganji headed a free kick terribly wide of the post.
He fell to his knees in frustration, as did several of his teammates, as Iran knew their chance to overtake the United States in the round of 16 might have passed.
There was desperation seconds from the end as Iran frantically called for a penalty, but the referee was uninterested and there was nothing to suggest foul play.
At the final whistle, the American players and substitutes sprinted to one end of the pitch in celebration as the Iranian team fell to the ground.