Lionel Messi produced a moment of trademark magic to help keep Argentina's World Cup hopes alive with victory in a tense encounter against Mexico.
In a cauldron of noise at Lusail Stadium, Messi and Argentina knew defeat would end their hopes of reaching the last 16 after only two games following the stunning loss to Saudi Arabia in their opener.
The tension was mounting as Mexico frustrated Messi in an attritional game, especially in a first half littered with fouls and stoppages that never allowed Argentina to gain any momentum.
Messi changed all that after 64 minutes when he took one touch to control a pass with his left foot before drilling an unerring finish past Mexico keeper Guillermo Ochoa into the bottom corner from 20 yards.
The masses of Argentina supporters in a crowd of 88,966 went wild in celebration and relief as their World Cup campaign got back on track.
Enzo Fernandez added a superb second with a curling shot into the top corner three minutes from time but it was Messi who made the breakthrough and the difference.
Victory in a tough final Group C game against Poland will send them into the knockout phase.
Messi delivers the magic once again
Messi cut a frustrated figure for the first 45 minutes here, pushed to the margins as this crucial game descended into a bitty affair spoiled by fouls, with little of quality on show.
It was when the game settled down, the stoppages reduced and a football match broke out that Messi was finally able to exert his influence, wandering far and wide on the vast expanse of Lusail Stadium before finally making the decisive contribution.
In an ear-splitting atmosphere, Messi turned up the volume even more with that breakthrough goal that finally broke Mexico down and reignited Argentina's World Cup.
Messi produced two perfect touches with that wand of a left foot, one to control and one to arrow a finish beyond Ochoa's outstretched right hand.
It was what all of Argentina hoped for and demanded from their great talisman and, as so often before for club and country, the 35-year-old produced when they needed him most.
This highly-touted side had faced real jeopardy. Argentina knew defeat would finish them here in Qatar. Messi knew defeat would end his dream of lifting the World Cup, the major honour missing from his glittering and extensive honours list.
He followed another superstar in Kylian Mbappe, whose two goals against Denmark put France into the last 16, and he showed here he is determined not to be outshone by the other members of his elite group.
Mexico, backed by their own massed ranks of fans, were in no mood to step aside and it took that big moment to unlock them, bowing to Messi as so many others have done before.
There is still work to do for Argentina when they face Group C leaders Poland, who boast a sporting icon of their own in striker Robert Lewandowski, but the celebrations at the final whistle gave the impression that a team hotly tipped to lift the World Cup at this same Lusail Stadium believe their show is now on the road thanks to their captain and resident genius.
Player of the match
Mac AllisterAlexis Mac Allister
Argentina
Squad number20Player nameMac Allister
Squad number24Player nameFernández
Squad number10Player nameMessi
Squad number25Player nameMartínez
Squad number13Player nameRomero
Squad number9Player nameÁlvarez
Squad number14Player namePalacios
Squad number26Player nameMolina
Squad number11Player nameDi María
Squad number22Player nameMartínez
Squad number8Player nameAcuña
Squad number18Player nameRodríguez
Squad number7Player nameDe Paul
Squad number19Player nameOtamendi
Squad number23Player nameMartínez
Squad number4Player nameMontiel
Mexico
Squad number13Player nameOchoa
Squad number22Player nameLozano
Squad number26Player nameÁlvarez
Squad number10Player nameVega
Squad number3Player nameMontes
Squad number2Player nameAraújo
Squad number16Player nameHerrera
Squad number15Player nameMoreno
Squad number18Player nameGuardado
Squad number25Player nameAlvarado
Squad number9Player nameJiménez
Squad number24Player nameChávez
Squad number23Player nameGallardo
Squad number21Player nameAntuna
Squad number14Player nameGutiérrez
Line-ups
Argentina
Formation 4-4-2
23Martínez
4Montiel19Otamendi25Martínez8Acuña
11Di María7De Paul18Rodríguez20Mac Allister
10Messi22Martínez
23Martínez4MontielBooked at 43minsSubstituted forMolinaat 63'minutes19Otamendi25Martínez8Acuña11Di MaríaSubstituted forRomeroat 69'minutes7De Paul18RodríguezSubstituted forFernándezat 57'minutes20Mac AllisterSubstituted forPalaciosat 69'minutes10Messi22MartínezSubstituted forÁlvarezat 63'minutesSubstitutes
1Armani2Foyth3Tagliafico5Paredes6Pezzella9Álvarez12Rulli13Romero14Palacios15Correa16Almada17Gómez Villaverde21Dybala24Fernández26MolinaMexico
Formation 5-3-2
13Ochoa
26Álvarez2Araújo3Montes15Moreno23Gallardo
24Chávez16Herrera18Guardado
22Lozano10Vega
13Ochoa26ÁlvarezSubstituted forJiménezat 66'minutes2AraújoBooked at 22mins3Montes15Moreno23Gallardo24Chávez16HerreraBooked at 66mins18GuardadoSubstituted forGutiérrezat 42'minutesBooked at 50mins22LozanoSubstituted forAlvaradoat 73'minutesBooked at 89mins10VegaSubstituted forAntunaat 66'minutesSubstitutes
1Talavera4Álvarez5Vásquez6Arteaga7Romo8Rodríguez9Jiménez11Funes Mori12Cota14Gutiérrez17Pineda19Sánchez20Martín21Antuna25AlvaradoReferee:Daniele OrsatoAttendance:88,966Live Text
Match ends, Argentina 2, Mexico 0.
Second Half ends, Argentina 2, Mexico 0.
Lionel Messi (Argentina) wins a free kick in the defensive half.
Foul by Jesús Gallardo (Mexico).
Foul by Lionel Messi (Argentina).
Héctor Moreno (Mexico) wins a free kick in the defensive half.
Foul by Nicolás Otamendi (Argentina).
Luis Chávez (Mexico) wins a free kick in the attacking half.
Lionel Messi (Argentina) wins a free kick on the right wing.
Foul by Héctor Moreno (Mexico).
Roberto Alvarado (Mexico) is shown the yellow card for a bad foul.
Nicolás Otamendi (Argentina) wins a free kick in the defensive half.
Foul by Roberto Alvarado (Mexico).
Foul by Enzo Fernández (Argentina).
Luis Chávez (Mexico) wins a free kick on the right wing.
Goal! Argentina 2, Mexico 0. Enzo Fernández (Argentina) right footed shot from the left side of the box to the top right corner. Assisted by Lionel Messi following a corner.
Corner, Argentina. Conceded by Néstor Araújo.
Corner, Mexico. Conceded by Nicolás Otamendi.
Foul by Exequiel Palacios (Argentina).
Uriel Antuna (Mexico) wins a free kick on the right wing.
Get the latest results and goal notifications for any team at the Fifa World Cup by downloading the BBC Sport app: Appleexternal-link - Androidexternal-link - Amazonexternal-link
Get your daily dose of Fifa World Cup reaction, debate & analysis with World Cup Daily on BBC Sounds