Colombia had won their group at the expense of hosts Argentina and, with highly-rated striker Radamel Falcao in their ranks, were expected to reach the semis against a side which just sneaked into the second phase as a third-placed pool finisher.
But Falcao was left kicking himself after the FC Porto forward missed a penalty in normal time for the 2001 champions.
Peru have not won the event since 1975, while they last appeared in the semis in 1997, but they battled hard to take the game into the extra half-hour.
Peru coach Sergio Markarian gave his players credit for a fine - if somewhat unexpected - victory. "I salute them because they applied themselves really well. They showed great tactical discipline, were committed and made a great effort," said Markarian, who took over a side which came rock bottom of the South American FIFA World Cup™ qualifying group.
They were scratching their heads as to how they did not win over 90 minutes as, quite aside from Falcao's wretched luck with his spot-kick just wide, Dayro Moreno hit the post and Fredy Guarin the bar.
Peru did have their chances in normal time, a Vargas shot repulsed by Colombian goalkeeper Luis Martinez, who then had to be alert after the break to save well with his fingertips from William Chiroque.
Peru edge ahead in extra time
But it was a Martinez error which helped break the deadlock as he fumbled an attempted punched clearance and Lobaton reacted in a flash to blast the ball past him and into the net.
The Peruvians then delivered the finishing blow on the counter attack as Guerrero fed Vargas, who trapped the ball, then drilled another fierce effort home past the despairing Martinez.