Panama advanced to the Copa America quarterfinals for the first time, beating Bolivia 3-1 to finish second in Group C. (More Football News)
Panama will play the Group D winner in the quarterfinals, most likely Brazil or Colombia.
José Fajardo scored in his second straight game, putting Panama ahead in the 22nd minute.
Bruno Miranda tied the score in the 69th minute, a goal that temporarily dropped Panama behind the United States into third place.
Eduardo Guerrero gave Panama a 2-1 lead in the 79th, pushing his team back into position to advance, and César Yanis added a goal in the first minute of stoppage time.
Panama, under Danish coach Thomas Christiansen, was in the Copa America for the second time.
Brazilian referee Edina Alves and assistants Neuza Back of Brazil and Mary Blanco of Colombia became the first all-female on-field officiating crew in the Copa America.
Fajardo scored when he settled a header from Christian Martínez near the penalty spot and volleyed it over goalkeeper Guillermo Viscarra for his 12th international goal.
Miranda scored Bolivia's first goal of the tournament when he settled a pass from Ramiro Vaca with his right foot and slid a shot by goalkeeper Orlando Mosquera inside the near post.
Guerrero scored with a diving header in the 79th off Éric Davis' cross and Yanis scored seconds after entering as a substitute, settling Guerrero's header and launching a shot into the upper corner.
Panama was without Adalberto Carrasquilla, who got a red card for a reckless foul on Christian Pulisic toward the end of its win last week.