The race split after an intense battle in the last climb of the day, the Alto de Puig Llorença, with more than 20km to go and the Colombian climber made the most of the situation to open up a five-second gap to a chasing group led by Nicolas Roche (Sunweb) ahead of Primoz Roglic (Jumbo-Visma).
Leader after the Stage 1 TTT, Miguel Angel Lopez (Astana) lost 37 seconds handing Roche the red jersey ahead of Quintana by two seconds with Rigoberto Urán (EF Education First) third at eight seconds.
“I don’t think I’ve ever won a stage like this, but there’s a first for everything," Quintana said. "It was beautiful and special. The team and I needed something like that. We’ve worked brilliantly today and it brings results."
It took 15km for a break to get away at the bottom of the 20km climb up the Puerto de Confrides with Sander Armée (Lotto Soudal) and Angel Madrazo (Burgos-BH) making the most of it with the latter claiming the first mountains points 1min 30sec ahead of two chasers, Jonathan Lastra (Caja Rural-Seguros RGA) and Willie Smit (Katusha-Alpecin).
The chasers join the leading duo in the second climb of the day, the Alto de Benilloba, where Madrazo takes three more points at the summit with the gap to the peloton at 6min 30sec.
The escape was in danger of sticking when Bora-Hansgrohe started to peg them back with 130km to go. Armée later struck out on his own but surrendered to the inevitable with 30km left to race.
The last climb of the day on the Alto de Puig Llorença broke the stage wide open when Alejandro Valverde (Movistar) set a hard tempo with only 20 riders able to follow his effort.
The stage opened up further when six of the 20 riders attacked with 20km to go, including Quintana, Roche, Roglic, Uran, Mikel Nieve (Mitchelton-Scott) and Fabio Aru (UAE Team Emirates).
The group opened up a lead of 20 seconds on the chasers including Stage 1 leader Lopez before Quintana accelerated again with 3km to go and soloed to the victory.
"Nothing was planned," Quintana said. "We climbed Puig Llorença at a very high speed and the group was smaller than we expected. Alejandro [Valverde] and I have shared the roles very well to finish it off.
"There was a split and the six of us were motivated to work together and open differences. I managed to make the most of this tense situation."