The 25-year-old beat Briton Adam Yates (Mitchelton-Scott), who went on the attack on Sunday, by 14 seconds in the overall classification and fellow Colombian Egan Bernal (Team Sky), recent winner of Paris-Nice, by 17 seconds.
It was the Kazakh-funded outfit's 21st victory of the season after stage wins on Paris-Nice and Tirreno Adriatico as Lopez added to his Tour of Colombia title.
The stage was marred by a crash in a descent that took down Romain Bardet, who finished second in the 2016 Tour de France and third a year later.
AG2r-La Mondiale rider Bardet, along with fellow Frenchman Romain Barguil, the 2017 Tour's best climber, abandoned the race.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
There were no details on Bardet's injuries while Barguil's team Arkea-Samsic said he sustained cuts and bruises.
(Reporting by Julien Pretot; Editing by Toby Davis)
