Astana rider Lopez, 22, moved into the overall lead after finishing second in Saturday's time trial, and held on to the yellow jersey by finishing safely in fourth place on the last day.
Lopez edged out Jon Izaguirre by 12 seconds, with Frenchman Warren Barguil just six seconds further adrift.
Sunday's route was cut to just 57km because of poor weather, and Pantano took advantage by outsprinting Russian Sergei Chernetckii and Spain's Izaguirre to take the stage.
It meant a fast pace before the crucial difficulty of the day, the 13km climb up the Fluela Pass before the final 17km descent to the finish.
Pantano was part of a three-man attack on the climb before Lopez, who finished seventh in this race as a neo-pro a year ago, gave a display of his authority by bridging up to the leaders.
He then pushed on with only Pantano and Tejay Van Garderen able to follow before a third acceleration allowed him to crest the summit alone with a 30sec lead.
Four chasers caught Lopez with 8.5km still to ride while two more joined just before the sprint finish.
The big loser was American Andrew Talansky, who started the day second overall at just 8sec.
He was dropped on the climb and eventually finished 56sec back, falling to fifth overall.
Pantano climbed above Talansky, meaning two Colombians finished in the top four.
Last year's winner Simon Spilak of Slovenia ended up ninth overall while Briton Geraint Thomas, one of the pre-race favourites, struggled on the final climb and dropped out of the top 10.