Argentina are through to the knockout round of the World Cup, thanks to an 86th-minute goal by Manchester United defender Marcus Rojo.
Rojo latched on a cross from Gabriel Mercado to slot home to an eruption of celebration for Argentina's fans.
The two-time World Cup winners were on the verge of going out as a Victor Moses penalty in the 51st minute canceled out Lionel Messi's 14th minute opener.
Argentina needed to win to qualify and seemed like they were on their way out until Rojo's strike.
Messi's goal was his first in this World Cup and the 100th goal of the tournament.
Argentina will meet France in the first quarter-final match at 10 am on Saturday.
Meanwhile, Croatia defeated Iceland also by a 2-1 margin, to top the group and face Denmark on Sunday in the quarter-finals.
The other quarter-final match-ups so far are Uruguay vs Portugal on Saturday and Spain vs Russia on Sunday.