The Colombian completed the 65km race – the shortest road-race stage in the Tour – in 2:21:27, 28 seconds ahead of UAE Team Emirates’ Dan Martin. Yellow jersey Team Sky’s Geraint Thomas followed home in third.
With the result Thomas extended his race lead to one minute and 59 seconds ahead of Team Sunweb’s Tom Dumoulin in second, as teammate Chris Froome dropped to third.
The newly implemented grid start, a formation determined by the respective riders’ general classification positions, had little or no effect at the start of the stage as the peloton almost immediately amalgamated from the outset.
Tanel Kangert, Thomas De Gendt and Pierre Rolland went off the front, before Franco Pellizotti set off in pursuit of the trio. Behind, a breakaway group began pulling away from the peloton.
Several riders began to spring from the peloton in an attempt to catch the breakaway. The breakaway eventually increased to approximately 20 riders when Kangert held a 20-second lead.
The breakaway split slightly in the early section of the first climb, before Nicolas Edet managed to catch Kangert at the head of affairs.
Julian Alaphilippe led the chase for the front two, part of a trio with Jesus Herrada and Kristijan Durasek, as Kangert accelerated and dropped Edet.
The trio passed Edet and were 25 seconds behind Kangert, with the breakaway group just over a minute behind. The peloton were trailing by two-and-a-half minutes.
With 40km remaining, Alaphilippe caught Kangert, as Durasek joined in at the front. Seven kilometres on, Alaphilippe, Kangert, and Durasek led by almost three minutes as the peloton thinned out dramatically and the chasing group had split.
Alaphilippe led at the front with 20km remaining, as Durasek dropped slightly and held a 23-second lead over the chasing group.
Hitting the final climb with 16km left, Alaphilippe and Kangert led by less than a minute. Kangert then dropped Alaphilippe, before soloing ahead.
In the first kilometre of the climb, Quintana attacked from within the peloton and created a 25-second lead. Team Sky – including Thomas – remained calm.
Primož Roglič then also attacked and Froome followed, which created a stir regarding general classification ambitions. Roglič was fourth overall before the stage and Froome second.
Froome and Roglič later dropped back again.
With 11km remaining, Kangert led by almost two minutes. Quintana and Majka were giving chase, before Kangert was eventually caught with 8.5km left.
Quintana and Majka had a 15-second lead over Dan Martin and were just over a minute ahead of the peloton.
A few kilometres on, Quintana dropped Majka, with Martin 20 seconds behind in pursuit of the leader.
Roglič again attacked from within the peloton with less than 3km left, but this time Thomas followed, as Froome got distanced.
Quintana prevailed to claim the stage win as Martin did enough to come home second. Thomas remained at the head of the general classification as he surged ahead late up the climb to take third.
“It was a hard day, but we prepared well for it. It went as exactly as we had planned,” Quintana said afterwards.
“We knew it was a stage for pure climbers and we showed our strength. “I went through some difficult moment in the first part of this Tour and lost some time. But I still felt strong and had the energy to finish the race on a high.
“I wanted to win for my people in Colombia, after months of hard work. All the support I’ve had from everyone, as well as my family and friends, really helped me today.”