A superb late volley from defender Marcos Rojo rescued Argentina and set up a tantalising FIFA World Cup last-16 tie with France.
The South American side beat Nigeria 2-1 at the Krestovsky Stadium in Saint Petersberg as Croatia won Group D with a victory by the same scoreline over Iceland at the Rostov Arena.
Croatia are now due to face Denmark for a place in the quarter-finals.
A lacklustre Argentina were on the verge of a humiliating defeat after Lionel Messi's brilliantly taken opener was cancelled out by a Victor Moses penalty.
It followed a Javier Mascherano error which epitomised another poor display.
But, just when hope was running out, Rojo surged into the area to volley home from Gabriel Mercado's cross.
Croatia continued their perfect start to the tournament to match Uruguay with a 100 per cent group stage record.
They took the lead through Milan Badelj before Iceland's Gylfi Sigurðsson won and converted a penalty to level when Dejan Lovren handballed.
Ivan Perišić, one of only a few players to keep their place from the win over Argentina last week, then fired home a late winner.
Peru scored their first goal of the tournament and enjoyed their first win at a World Cup since 1978 in Group C, despite already having been eliminated.
A superb 15-yard volley from Andre Carrillo proved broke the deadlock Australia at the Fisht Olympic Stadium in Sochi.
Peru captain Paolo Guerrero, only able to play in the tournament after a Swiss Tribunal overturned a 14-month drugs ban shortly before the tournament, spun and shot into the far corner to seal the win.
Good defending denied Australian any chance of fighting-back, and Christian Cueva also hit a post for Peru late on as they finished third in the group above Australia.
It ended a Peruvian run of eight World Cup finals matches without a win and was only the fifth victory in their history.
Denmark and France played out the first 0-0 match of the World Cup in a disappointment to the crowd at Moscow's Luzhniki Stadium.
The encounter was greeted by boos at the final whistle as the whole intensity of the match slowed as news of the Peru scoreline drifted through.
Both teams progressed due to the Australian defeat.
It took until the 39th minute for the first shot, when Antoine Griezmann launched a tame effort and Kasper Schmeichel, and excitement levels only declined from there.
Action is due to conclude in Groups E and F tomorrow.
In Group E. Serbia and Brazil are set to meet at Moscow's Otkritie Arena and Switzerland face Costa Rica at the Nizhny Novgorod Stadium.
In Group F, South Korea and Germany are due to meet at the Kazan Arena and Mexico play Sweden at Yekaterinburg's Central Stadium.