But there was no question of luck with his second, with Messi curling a wonderful free-kick into the top corner to bring the Soldier Field crowd to its feet in the 78th minute.
With Panama's heads down, Messi then duly completed his quick-fire hat-trick - skipping clear of a marker inside the penalty area to finish emphatically for 4-0.
There was still time for Messi to have a hand in Argentina's fifth goal of the evening, providing a sublime pass in the build-up to Sergio Aguero's close range headed effort in the 90th minute.
Aguero's Manchester City team-mate Nicolas Otamendi had opened the scoring for Argentina in the seventh minute, heading home an Angel Di Maria free-kick from close range.
The victory sees Argentina, convincing 2-1 winners over Chile in their opening game, guaranteed a spot in the last eight with one group game remaining.
The only blemish on the evening was an injury to Angel Di Maria, who limped off in the first half to extend his miserable record of injuries in major tournaments.
The Paris Saint-Germain winger was injured in the 2014 World Cup, missing the final, and was also injured during last year's Copa America in Chile.
Argentina are now firmly on course to top Group D, with only one game against pointless Bolivia to come.
Messi, who came on for Augusto Fernandez at the 61-minute mark, netted in the 68th, 78th and 87th minutes in what became a 5-0 rout for Albicelestes.
Nicolas Otamendi scored in the seventh minute and Sergio Aguero in the 90th but Messi stole the show with his latest extraordinary feat, playing just 29 minutes of the match.