Chris Froome enhanced his reputation as one of the best Tour de France riders when he virtually secured his third title, holding on to his overall lead in the last competitive stage, won by Spain's Ion Izagirre.
Froome will wear the yellow jersey in the closing stage, a largely processional ride to the Champs Elysees in Paris tomorrow and is highly likely to join Belgium's Philippe Thys, American Greg LeMond and France's Louison Bobet on the list of triple winners.
Ahead of them are five-times champions Miguel Indurain of Spain, Belgian great Eddy Merckx, Frenchmen Bernard Hinault and Jacques Anquetil.
"It's been a really intense race. It's an incredible feeling to cross the finish line with my team mates, I want to thank them for their hard work, they've been with me every step of the way," Froome said.
The 31-year-old, who started the 146.5-km stage with a bandage on his right knee following a crash on Friday, was never threatened on a stormy and rainy day in the Alps.
He stayed safe on the slippery descents, well protected by his Sky team mates, and crossed the line with a relieved smile on his face.
Froome, who is set to become the first rider to retain his title since Indurain in 1995, leads France's Romain Bardet by four minutes five seconds.
Nairo Quintana of Colombia, runner-up in 2013 and 2015, is third overall, 4:21 off the pace, while another Briton, Adam Yates, is fourth at 4:42 and will don the white jersey for the best under-25 rider in Paris.
Riders and officials, with German champion Andre Greipel in front of the peloton, observed a minute's silence in tribute to the victims of Friday's mass shooting in Munich before the start of the stage.
Czech Roman Kreuziger, who started the day in 12th place overall 9:45 off the pace, was part of the day's breakaway that also featured his Tinkoff team mate Peter Sagan, the world champion voted the most aggressive rider of the race, as well as 2014 champion Vincenzo Nibali among others.
They built up a maximum advantage of 6:22, meaning Kreuziger was virtually second overall, but the Astana team, protecting Fabio Aru's sixth place in the general classification, pulled in front of the pack to reduce the gap.
Aru cracked on the last climb and slipped out of the top 10.
On the last climb to the intimidating Col de Joux Plane, an 11.6-km ascent at an average gradient of 8.5 percent, Nibali attacked to catch and drop France's Julian Alaphilippe and Colombian Jarlinson Pantano.
Pantano, however, joined him near the top along with Izagirre, who came from behind, and the three went on to contest the stage win on the dangerous, wet descent.
Izagirre took risks, reaching a top speed of about 80 kph to ride clear for Spain's first stage win in this Tour.