The Astana climber attacked the main bunch of favourites, eight kilometres from the finish atop La Molina, bridged to the remnants of the day's break, Catalan local Marc Soler (Movistar) and BORA-Hansgrohe's Gregor Mühlberger, powering away from the pair six hundred metres to the line.
The Colombian earned the leader's jersey for his efforts, Adam Yates and Egan Bernal finishing just behind Soler and Mühlberger, 16 seconds in arrears.
'Superman' Lopez now leads Yates by 14 seconds and Team Sky's young gun by 17 and the stage victory continued Astana's stunning early 2019 form.
"I knew this stage could be a good moment to do something in the general classification," Lopez said.
"So, with the whole team we were motivated to do it well. The team did a great job for me during the whole day, protecting me well and providing me a very good position on the last climb. Yesterday I saw I have the legs to stay with the strongest riders of this race, so today I decided to try to attack on the final climb.
"Maybe, it was a risk... I just went away, keeping the highest pace I could and this brought me the stage win. I am really happy with this victory, especially after being close to it last few times.
"Now I am the leader of the overall, but, for sure, the race is still open. We still have three stages to go and the battle for the GC is still ahead. I am happy with my win, so now I will move day by day in this race."
A group of around 25 riders including Soler, Mühlberger and Yates' team mates Tsgabu Grmay and Daryl Impey broke free on the descent of the Coll de Coubet, the first gruelling climb of the 150km stage.
But the hors category, 20km Port de la Crueuta climb destroyed the lead group as Sky turned the screws behind for Bernal, Chris Froome dutifully pulling turns on the front.
As the main bunch faced the final of two ascents of La Molina, just Soler and Mühlberger remained with only two minutes up their sleeve. Behind, Lopez attacked twice; his first drawing Bernal, Quintana and Yates who distanced the likes of UAE's Dan Martin and Quintana's Movistar colleague Alejandro Valverde; his second only moments later produced some daylight as Bernal, Yates, Quintana and Steven Kruijswijk (Jumbo-Visma) held on to the finish.
Yates was upbeat at retaining his second place overall.
“It was another good day. There was a big break today and we had both Impey and Tsgabu in there just in case anything kicked off early so they could be help out in the deep final. In the end once Sky started riding a hard tempo it all came back together quite quickly.
“The rest of the guys rode super to keep me out of the wind and then set me up perfectly for the final circuits.
"In the final, I was feeling pretty good but a bit like yesterday there was some games being played and Lopez managed to jump off the front and steal some seconds. It was good to have Simon there to ride in the final as well, otherwise the gap might have blown out because none of us were cooperating that well.
“As we said from the beginning this race is not over until Barcelona so we’ll have to wait and see what happens in the next few days.”