Australia's Richie Porte claimed the penultimate seventh stage of the Paris-Nice atop the Col de la Couillole on Saturday but Colombia's Sergio Henao took the overall lead.
France's Julian Alaphilippe had held the leader's yellow jersey since Wednesday but he was left behind on the challenging final climb and came home more than two and a half minutes behind.
The Col de la Couillole, which stands 1678m tall to the north of Nice, is the highest finish in the 75-year history of the Paris-Nice. Porte finished 20 seconds clear of Spain's former Tour de France winner Alberto Contador.
The BMC rider, who won the Paris-Nice in 2013 and 2015, attacked in the final three kilometres of the 177km ride to secure victory on the queen stage of this year's race.
"It was an incredible satisfaction, words don't sum the feelings up," said Porte, who is not in the running for overall victory, placed 12th behind Henao at 14min 26sec.
Henao, of the troubled Sky team, faded towards the end of the stage and was beaten for third place by Ireland's Dan Martin.
Nevertheless, he now leads by 30 seconds from Martin and 31 seconds from Contador ahead of Sunday's eighth and final stage, a 115.5km loop to the north of Nice featuring five climbs.
"The day went well for me. We will see what happens in the final stage. I remember last year Geraint Thomas only just won it," said Henao.
"I'm expecting it to be difficult. Dan Martin is dangerous, you only need to look at the way he came back today. His team also has Alaphilippe and Contador is also ready for the fight."
Sky have been hit by doping and sexism rows in recent weeks, their reputation taking a battering as a result.
Henao said he hoped to see out the win for beleaguered team chief Dave Brailsford.
"I'd like to stay in yellow on Sunday so I can dedicate the victory to the team and to Dave."