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.