Lionel Messi scored a magical hat trick in 19 minutes as Argentina cruised into the Copa America Centenario quarterfinals with a 5-0 rout of Panama Friday. In Foxborough, Arturo Vidal scored a controversial penalty deep into injury time as holder Chile snatched a dramatic 2-1 victory over Bolivia to keep its campaign alive. Messi had been forced to delay his debut in the tournament after a slow recovery from a lower back injury, with Argentina coach Gerardo Martino surprisingly naming him amongst the substitutes once more. But Messi wasted no time in stamping his genius on the tournament after coming on in the 61st minute to replace Augusto Fernandez with Argentina leading the Group D game 1-0. An electrifying cameo from the Barcelona superstar began with his first goal of the tournament on 68 minutes, finishing with aplomb after Gonzalo Higuain's shot bounced off a Panamanian defender into his path. But there was no question of luck with his second, with Messi curling a wonderful freekick 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 teammate Nicolas Otamendi had opened the scoring for Argentina in the seventh minute, heading home an Angel Di Maria free-kick from close range. "I'm happy to be playing again, I really wanted to play tonight," a satisfied Messi said. Shellshocked Panama coach Hernan Dario Gomez, the experienced Colombian, was left in awe by Messi's masterclass. "Messi is a monster," Gomez said. "Before he came on the match was quite even. But with Messi you make one mistake, and you pay for it." Aguero's Manchester City teammate Nicolas Otamendi had opened the scoring for Argentina in the seventh minute, heading home an Angel Di Maria freekick from close range. The victory sees Argentina, convincing 2-1 winner 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 Di Maria, who limped off in the first half to extend his miserable record of injuries in major tournaments. Friday's win marked a dazzling return to the spotlight for Messi, who is determined to help lead Argentina to its first major international tournament victory for 23 years. In Foxborough, Chile earned a controversial 2-1 victory over Bolivia. Bayern Munich star Vidal struck from the spot in the 10th minute of time added on after a hugely debatable penalty was awarded against Bolivian defender Luis Gutierrez for handball by US referee Jair Marrufo. Earlier a stunning 61st minute free-kick from Kuwait-based playmaker Jhasmani Campos appeared to have grabbed a share of the points for Bolivia at Gillette Stadium after Vidal had given Chile the lead just after half-time.