Match ends, Nigeria 1, Argentina 2.
Marcos Rojo scored a fine late volley to send Argentina through to the last 16 of the 2018 World Cup with a dramatic victory over Nigeria in St Petersburg.
A lacklustre Argentina were on the verge of an embarrassing exit, before Manchester United defender Rojo surged into the area to place Gabriel Mercado's cross into the bottom corner.
Lionel Messi, who had scored a brilliant opener, jumped on Rojo's back as he sprinted away in delirious celebration, joined by the entire Argentina bench in the corner.
It was a result they scarcely deserved after a poor second-half showing, epitomised by the Javier Mascherano error that allowed Victor Moses to equalise with a penalty.
But once their ragged defence had held on until the final whistle, the Argentina players embraced each other in the centre of the pitch, waving to their vociferous fans, a disjointed side united for now.
They will face Group C winners France in the last 16 in Kazan on Saturday, while Group D winners Croatia, who secured top spot by beating Iceland 2-1, play Denmark.
- World Cup Daily: Messi turns up for Argentina… finally
- How the players rated in Nigeria v Argentina
- Who needs what? Remaining group permutations
- Iceland exit World Cup as Croatia win
Messi's magical touch
Given Messi will be 35 during the next World Cup in Qatar in 2022, victory here has at least staved off a miserable end to what could well be his last chance to win the tournament.
The Barcelona striker, whose hint of a smile during the pre-match anthems was a stark contrast to his pained expression prior to the 3-0 defeat by Croatia, produced a superb first-half performance.
His opening goal displayed all his talent and composure. With Ever Banega looking to go over the top from deep, Messi cut sharply right and surged in behind the defence, with the Sevilla midfielder picking him out with a terrific pass.
Messi's first touch to cushion the ball on his left thigh was sublime, the second off his left boot to draw it away from Kenneth Omeruo exquisite, the finish into the far corner with his right emphatic.
Elsewhere he was efficient, threatening to create openings with every quick touch, and could have had a second but for Nigeria keeper Francis Uzoho's tremendous save to tip a free-kick onto the post.
With Argentina's players reportedly at odds with boss Jorge Sampaoli, it was perhaps telling that Messi delivered a second team talk to his side in the tunnel just before coming out for the second half.
His words failed to inspire them, with Messi increasingly isolated, but he had at least given his team-mates the foundation to salvage their World Cup.
Ageing Argentina scrape through
It is still hard to see Argentina progressing into the latter stages of this tournament without significant improvement, even if Messi goes on to put in performances for the ages.
This was the oldest starting side in the country's hugely successful World Cup history - with an average age of 30 years and 189 days - but it is a far from settled one.
Sampaoli made five changes from the Croatia defeat, including an international debut for 31-year-old keeper Franco Armani after Willy Caballero's blunder.
Some of those changes, like starting Banega, were overdue, but the decision to drop Sergio Aguero and then wait until two other substitutions had been made and 80 minutes had passed before introducing him was bizarre.
If Sampaoli has lost control of the dressing room, Mascherano is supposedly his side's real leader. But the former Barcelona and Liverpool defensive midfielder, who now plays for Chinese club Hebei China Fortune, looks shorn of his former talents, failing to offer protection to a shaky defence.
While not the most blatant example of holding, his grabbing of Leon Balogun in the box from a corner was naive and rightly penalised. Is there any way he can rally his team-mates for the challenge of France?
"It is very hard to see how Argentina can stand up to the French - if they are going to mount any challenge, it will have to be like it was four years ago when they played on individual talent," said BBC Sport's South American football expert Tim Vickery.
"France will not be too concerned about playing Argentina."
Wasteful Nigeria miss out
Just as in their victory over Iceland, Nigeria started cautiously, defending deep, before blitzing the opposition defence at the start of the second half.
Ahmed Musa finally started to test out the Argentina defenders with his pace, leaving them diving into tackles, and he was joined by Odion Ighalo, who replaced the ineffective Kelechi Iheanacho at the interval.
Nigeria induced panic, leading to Moses' penalty, which the Chelsea wing-back converted easily, sending Armani the wrong way as he slotted down the right-hand side.
But the Super Eagles could not keep their composure when close to a second goal, with Ighalo sending a weak shot straight at Armani and also slicing wide when a deflected Musa cross dropped into his path.
After that miss, the former Watford striker made a desperate appeal for a penalty, with referee Cuneyt Cakir consulting VAR but needing only one replay to dismiss the claim, Rojo having headed the ball into his arm.
Wilfred Ndidi also hit a powerful drive just over the bar but Nigeria ultimately could not take advantage of their rattled opponents.
Man of the match - Lionel Messi (Argentina)
'The World Cup starts here' - reaction
Argentina captain Lionel Messi: "We were confident we would win this game. It's wonderful to have won it this way - it is a well-deserved joy.
"I thank all the people who are here, for all their sacrifice, and all those who are in Argentina who were always with us. The shirt of the national team is above all."
Argentina centre-back Marcos Rojo: "We needed it, now the World Cup begins for us.
"Lionel Messi had told the guys he was going to score a goal more than ever. The goal is for my family and for this group that deserves it. Let's go Argentina!"
Nigeria captain John Obi Mikel: "We did everything we could. In the second half we pushed and pushed. It just wasn't to be. It's a young team and in four years most of them will be ready for this tournament.
"I'm very proud of the boys and what we have achieved. I think we have done really well. We have to keep going."
Messi ends drought against familiar foe - stats
- Lionel Messi's first-half strike for Argentina ended a run of 662 minutes without a goal in the World Cup - his last was in June 2014, also against Nigeria.
- Messi (2006, 2014 and 2018) is the third Argentina player to have scored in three different World Cup tournaments, alongside Diego Maradona (1982, 1986 and 1994) and Gabriel Batistuta (1994, 1998 and 2002).
- He has scored 50% of his World Cup goals against Nigeria (three of six).
- Argentina's opener in the 14th minute was the 100th goal scored at the 2018 World Cup.
- Argentina are unbeaten in their last 40 World Cup games when opening the scoring (W35 D5), since a 3-1 defeat against Germany in 1958.
- Marcos Rojo's goal was his second for Argentina at the World Cup, and his previous one also came against Nigeria - 1,462 days ago at the 2014 tournament.
- Nigeria have lost all six of their games against South American sides at the World Cup, with five of those coming at the hands of Argentina (in 1994, 2002, 2010, 2014 and 2018).
- 6BalogunBooked at 32mins
- 22OmeruoSubstituted forIwobiat 90'minutes
- 10MikelBooked at 90mins
- 14IheanachoSubstituted forIghaloat 45'minutes
- 7MusaSubstituted forSimyat 90+2'minutes
- 3TagliaficoSubstituted forAgüeroat 80'minutes
- 15PérezSubstituted forPavónat 61'minutes
- 14MascheranoBooked at 49mins
- 7BanegaBooked at 64mins
- 11Di MaríaSubstituted forMezaat 72'minutes
- 10MessiBooked at 90mins
- 20Lo Celso
- Cüneyt Çakir
- Shots on Target
Second Half ends, Nigeria 1, Argentina 2.
Lionel Messi (Argentina) is shown the yellow card.
Javier Mascherano (Argentina) wins a free kick on the right wing.
Foul by Simy (Nigeria).
Lionel Messi (Argentina) wins a free kick on the right wing.
Foul by John Obi Mikel (Nigeria).
Substitution, Nigeria. Simy replaces Ahmed Musa.
John Obi Mikel (Nigeria) is shown the yellow card for a bad foul.
Substitution, Nigeria. Alex Iwobi replaces Kenneth Omeruo.
Foul by Lionel Messi (Argentina).
Kenneth Omeruo (Nigeria) wins a free kick in the defensive half.
Goal! Nigeria 1, Argentina 2. Marcos Rojo (Argentina) right footed shot from the centre of the box to the bottom right corner. Assisted by Gabriel Mercado with a cross.
Attempt missed. Oghenekaro Etebo (Nigeria) right footed shot from outside the box is close, but misses the top right corner from a direct free kick.
Foul by Éver Banega (Argentina).
Wilfred Ndidi (Nigeria) wins a free kick in the attacking half.
Attempt saved. Odion Ighalo (Nigeria) right footed shot from a difficult angle on the left is saved in the bottom left corner.
Foul by Cristian Pavón (Argentina).
Ahmed Musa (Nigeria) wins a free kick in the defensive half.
Corner, Argentina. Conceded by Oghenekaro Etebo.