Argentina squeezed into the World Cup last 16 after Marcos Rojo's fine late volley gave them a 2-1 win over Nigeria in St Petersburg
With Nigeria heading through in Group D with four minutes remaining, the Manchester United defender popped up to convert Mercado's cross and send Jorge Sampaoli's side through in dramatic fashion
Needing a win to stand a chance of qualifying, Argentina went ahead through Messi (14), turning home from 10 yards at a slight angle after Ever Banega superbly found him from deep
Messi then hit the post with a free-kick, but Nigeria were allowed a path into the game as Victor Moses slotted home a penalty (51) from Javier Mascherano's tug on Leon Balogun from a corner
But Argentina won it, meaning they'll play France in Kazan on Saturday, while Croatia will play Denmark on Sunday
In their third and final group game, Sampaoli went for five changes and 4-4-2, his third different formation of the World Cup, but it worked early on
Banega, one of the incoming midfielders, played a fine ball from deep over the Nigeria defence for Messi, whose touch was superb before finishing past Francis Uzoho with his weaker right foot
Messi's fine through ball gave Gonzalo Higuain the chance to double their lead before the half-hour mark, but the Juventus striker couldn't dink the ball over the out-rushing Uzoho
Messi, who had been criticised in Argentina's first two games for looking out of sorts, was in the mood in St Petersburg, hitting the post with a 20-yard free-kick, though Uzoho can be credited again for getting the slightest touch on his effort
Early in a dramatic second half, Mascherano first gave away a needless corner before grappling with Balogun from the resulting cross, with Turkish referee Cuneyt Cakir going to VAR before awarding the spot-kick
 Victor Moses duly converted, meaning Nigeria were through as it stood
Odion Ighalo then missed a clear chance to put Nigeria ahead as the ball dropped kindly to him 10 yards out, while at the other end Higuain blazed over unmarked in the box from Rojo's centre
But Argentina got their vital winner shortly after, as Rojo met Gabriel Mercado's cross from the right superbly, slamming low past Uzoho from 12 yards and sparking jubilant scenes on and off the pitch
Brought in as one of five changes, Banega's quality on the ball put Argentina in control in the first half
Though his influence reduced after the break, his ball for Messi for the opener was world class; from deep, his lofted pass over the defence left the forward with a clear sight at goal
He won all of four of his attempted tackles, and recovered the ball more than any other Argentina player
 "It's a big disappointment because my team gave their best, they made a very good second half and missed qualifying by a few minutes
 So I am proud of my players because they played well in the second half
 We are missing a little bit of experience, we have a young team and I think this kind of matches are building the character of the team and in four years they will be very strong
": "My players put their hearts out, with a lot of courage, in a very difficult moment
 They have achieved a triumph which is very important for the future and that will strengthen us going further
"Argentina will now play France in Kazan on Saturday, having finished second in Group D
 Winners Croatia face Denmark on Sunday
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>