Argentina and Nigeria both qualified for the last 16 of the World Cup despite two Lionel Messi goals condemning the African side to a 3-2 defeat in their final group game.
The Barcelona forward netted a fierce opener, but Ahmed Musa equalised within 80 seconds with a curling finish.
Messi made it 2-1 before the break with a 25-yard free-kick, but Musa grabbed his second after bursting through.
Marcos Rojo scored Argentina’s winner, knocking in a corner with a knee.
The result means Argentina finish top of Group F with three wins from three games, while Nigeria qualify in second with four points after Iran failed to defeat Bosnia-Hercegovina.
Nigeria will face France in the last 16 in Brasilia next Monday, while Argentina take on Switzerland a day later in Sao Paulo.
They progressed after another goal-laden World Cup match.
It only took three minutes for the deadlock to be broken as Messi smashed home after Angel Di Maria’s effort came off a post.
The celebrations had barely died down when Nigeria levelled. Midfielder Michel Babatunde – who was later stretchered off with a wrist injury – fed the ball into the left side of the area for Musa, who shifted to his right before curling in.
It was the first time in World Cup history that two opposing teams had both scored inside the first five minutes.
The forwards on show continued to expose the fragility of both defences, but it was not until stoppage time in the first half that the next goal arrived.
Messi, who moments earlier drew an exceptional save from Vincent Enyeama with a free-kick, struck a set-piece over the wall and beyond the reach of the Lille goalkeeper.
It was the 27-year-old’s fourth goal in three matches at Brazil 2014, having scored just once in his first eight World Cup appearances.