Messi's third-minute opener was immediately cancelled out by Ahmed Musa, before the Barcelona playmaker curled a delightful free kick into the top corner.
Nigeria hit back through Musa at the start of the second half, but Argentina earned the three points thanks to Marcos Rojo's goal from inside the six-yard box.
Despite the defeat, Nigeria have progressed through to the last 16 after Iran failed to beat Bosnia-Herzegovina.
Below, Sports Mole assesses whether Argentina were deserving of the three points.
On target: 3
On target: 13
Was the result fair?
If Nigeria had managed to find an equaliser during the closing stages, no-one would have been able to argue that they didn't deserve a point, but this was Argentina's best performance of the World Cup, and if this is a sign of things to come, then the rest of the field should be worried. There are still aspects of their defensive game that need tightening up, but from an offensive point of view, they had far too much firepower for the Nigeria backline.
Coach Stephen Keshi has spoken out about some of the criticism that his team have received, but he's unlikely to hear many detractors after a display of heart and flair. Like Argentina, they have their defensive frailties but for large parts of this game their power on the break troubled the South American outfit, and on another day they could have earned a result from this fixture. They will be up against it to get anything out of France next Monday, but if they can show the same tenacity as today anything is possible.
The match began perfectly for Alejandro Sabella's team who took the lead after three minutes. They were soon pegged back, but with their place in the second round already secured, they took the opportunity to prove that they could put together a performance that would make the rivals sit up and take note. Messi was the instigator behind a lot of their play, but Ezequiel Lavezzi also showed that he can be an important figure for this side as they look to progress in the competition. Tougher tests lie ahead, but this is a team who is growing into the competition.
Sports Mole's man of the match
Lionel Messi: He may have only been on the pitch for 62 minutes, but this award must go to the former world player of the year. While his goals helped him stand out in the previous games, it was his all-round performance that kept the crowd on the edge of their seats this time around. He was a constant threat, and while his free kick was something that only a genius could score, his coach will be happier with the way that he frequently had Nigeria on the back foot.
No gaffe stood out in Porto Alegre, but you could say that Vincent Enyeama found himself deceived by the magic of Messi. Moments before his second goal, Messi had Enyeama sprawling across his line to keep a set piece out, but the next effort caught the Nigerian, who was expecting the ball to go towards the other corner, out of position.
The match itself was an entertaining affair, but Italian official Nicola Rizzoli wasn't required to make any game-changing decisions. The biggest task that Rizzoli had was trying to discourage several of the Nigeria players from throwing themselves into challenges, but he only had varied success. Defender Juwon Oshaniwa was one player who was fortunate to avoid picking up a suspension for the next round.
Nigeria: Nigeria will play their last-16 tie in Brasilia on Monday. France are likely to be their opponents.
Argentina: Argentina's second-round fixture will take place in Sao Paulo next Tuesday. They will likely face either Ecuador or Switzerland.