Lionel Messi curled a stunning 91st-minute winner to send Argentina through to the World Cup knockout stage and rob the excellent Iran of a deserved point.
Iran spent much of the first half under pressure but more than once threatened to inflict what would have been a huge upset.
Argentina’s celebrations at the final whistle were wild and prolonged, while the sight of coach Alejandro Sabella embracing Messi at the tunnel gave an indication of what this meant to the two-time champions.
The build-up was dominated by talk of a rift between Messi and Sabella, the captain having expressed his displeasure at the 5-3-2 formation used in the first half againstBosnia-Hercegovina when Messi also scored the decisive goal.
Sabella duly reverted to the Barcelona forward’s preferred 4-3-3 and was rewarded by his star man at the last.
Iran looked devastated at the end but must take immense confidence from a performance that combined defensive resilience with attacking adventure – and from the knowledge they could still qualify.
Carlos Queiroz’s men actually created the first meaningful chance when Jala Hosseini headed wide from Ashkan Dejagah’s free-kick, although Argentina then assumed control.
Javier Mascherano and Fernando Gago provided a solid base for Angel Di Maria and full-backs Pablo Zabaleta and Marcos Rojo to support Messi, Gonzalo Higuain and Sergio Aguero.
Iran goalkeeper Alireza Haghighi displayed superb reflexes to foil Higuain and save one-handed from Aguero. Rojo then headed narrowly wide, Messi was off target with a free-kick and Ezequiel Garay nodded inches over the bar. The Iran fans celebrated every reprieve like a goal.