The Colombians should have taken the lead with a penalty in the 66th minute but striker Radamel Falcao put the ball wide.
With game 0-0 at the end of 90 minutes, Colombia goalkeeper Luis Martinez spilled the ball when he came out at a Vargas free-kick and substitute Lobaton fired into the roof of the net to put Peru ahead in the 12th minute of extra-time.
Ten minutes later, with Colombia pressing for an equaliser, striker Paolo Guerrero took possession in a counter-attack and passed to man-of-the-match Vargas, who rifled home.
"We have to recognise that if [Colombia] had slotted in the penalty it would have been a different match," Peru coach Sergio Markarian said at a news conference.
Markarian said that in extra-time his team produced their best 30 minutes of the tournament so far. "The tactic was to give Paolo [Guerrero] more support [up front]," he said.
Peru, who qualified from the group phase as the best third-placed team, will meet Uruguay in the semi-finals.
"We've taken a big step, not so much towards the Copa but towards the World Cup. This will unite us," Markarian said of his first efforts to revive the Peru team after years of disappointment.
The first real chance came after half an hour when Falcao shot just over from winger Dayro Moreno's pass after a rare error from central defender Alberto Rodriguez.
Then Peru's right winger William Chiroque began causing big problems for the Colombia defence. In the 34th minute, he crossed low to Vargas and the Peru captain' shot from 20 metres forced Martinez to dive and push the ball wide.
Peru keeper Raul Fernandez then dived at Falcao's feet to make the save while at the other end Colombia captain Mario Yepes's diving header cleared a dangerous cross from Guerrero.
A shot from Chiroque went close and Colombia scrambled away a couple more Peruvian half-chances early in the second half before creating some scoring chances themselves.
Yepes found Moreno with a good ball out of defence but the winger shot wide before Rodriguez fouled Moreno in the box but Falcao struck his penalty wide.
Two minutes later, another break by Colombia ended with Moreno hitting the bar with a fierce right-footed shot.
Going into the final 10 minutes, Peru midfielder Adan Balbin had a dipping shot from 25 metres tipped over by Martinez.
Midfielder Fredy Guarin almost scored two minutes into added-time when he jinked past two defenders on the left, cut in and shot with Fernandez tipping the ball over the bar for a corner.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.