Chris Froome is set to become the first Briton to win three Tour de France titles after safely negotiating a rain-soaked penultimate stage in the Alps.
The stormy weather made for treacherous racing on slippery roads but Team Sky's Froome survived the final descent into Morzine to maintain his overall lead.
Froome's lead over Romain Bardet of four minutes five seconds will not be tested on the final stage in Paris.
Stage 20 was won by Spanish Movistar rider Jon Izaguirre.
He rode clear of fellow breakaway riders Jarlinson Pantano of the IAM Cycling team and 2014 Tour de France winner Vincenzo Nibali to win the 146km stage in four hours, six minutes and 45 seconds.
Froome, who crashed on a rainy descent on Friday, was more cautious on Saturday's drop into Morzine and finished more than four minutes behind Izaguirre but only a few seconds adrift of his rivals in the overall standings.
"I still need to get the yellow jersey to Paris tomorrow but certainly the racing side is done and dusted," said Froome, who won the 2013 and 2015 editions of the three-week race.
"It's an amazing feeling of relief, just coming over the last line today. Thank you to all my team-mates, they've really been there for me every step of the way and I couldn't ask for more."
Frenchman Bardet finished six seconds ahead of Froome to cement second place, while Quintana, who said he "suffered from allergies" during the race, will finish third.
Has Froome won the title?
Tradition dictates that the man in the race leader's yellow jersey is not challenged during Sunday's largely processional final stage in Paris which starts from about 15:00 BST and is expected to end in a bunch sprint.
The 113km route from Chantilly will start in pedestrian fashion with Froome posing for photographs with his team-mates, sipping the obligatory glass of champagne.
The stage finishes with nine laps around the centre of Paris and Froome still has to race on the cobbles of the Champs-Elysees and make it across the finish line to be crowned champion for a third time.
In doing so, he will become just the eighth rider to win three Tour titles, following legendary five-time winners Jacques Anquetil, Eddy Merckx, Bernard Hinault and Miguel Indurain, while joining Philippe Thys, Louison Bobet and Greg LeMond who have all won three.
Froome is also set to become the first man since Indurain, who won his five titles consecutively from 1991, to successfully defend the title.
Tour director Christian Prudhomme said it was Froome's incredible attacks on stages eight and 11 that were the stand-out moments for him.
"There was no surprise because Chris Froome won. But for me it was not the same as in previous years," he said.
"When he attacked in the Peyrsourde descent it was such a surprise. And he did it again when he went with Peter Sagan in Montpellier. I liked it very much. Chris Froome was very good, his opponents less good."
Where did Yates finish?
Britain's Adam Yates will finish a terrific fourth overall and in possession of the white jersey as the best rider under the age of 25.
The 23-year-old from Bury was second from stages seven to 12, and only lost third place to Nairo Quintana, one of the pre-race favourites, on Friday's penultimate stage in the mountains.
However, his initial nine-second deficit became 19 when he was penalised 10 seconds for receiving a push from an Orica BikeExchange team-mate. That gap was extended to 21 seconds as he finished Saturday's stage behind Quintana.
Yates' consolation was retaining the white jersey, which he won by two minutes and 16 seconds ahead of South Africa's Louis Meintjes.
Were there any nervous moments for Froome?
Froome knew only too well how easily a slip could have cost him dearly on the wet descents in this undulating stage, with his right knee bandaged from a fall in similar conditions on the previous day.
He had also suffered road rash on his back and, with the road damp and the downhill finish looking dangerous, he was mindful to stay safely around his team-mates.
Geraint Thomas, who handed over his bike to Froome on Friday to let his team leader complete the stage, did the job of guiding the yellow jersey up and over Col de Joux Plane, the final mountain of this year's Tour.
All of the general classification front runners remained in the peloton with Froome, and the pace was only increased when Roman Kreuziger had leapt from 12th to second overall, causing slight concern among the podium contenders.
In the end, Czech Kreuziger was unable to maintain the pace and a large breakaway was whittled down to the pairing of Jarlinson Pantano and Julian Alaphilippe, who were soon joined and passed by 2014 champion Vincenzo Nibali.
Nibali, a favourite to win road race gold at the Olympics next month, was caught by Pantano and a resurgent Izaguirre, and the Basque-born rider descended impeccably to claim his first Tour de France stage win and Movistar's first of this year's Tour.
"I think my parents must have been scared watching at home," he said. "I wanted to drop Nibali because I was worried about him in a sprint. Beating Nibali in a downhill is something that counts in a career."
General classification after stage 20:
1. Chris Froome (GB/Team Sky) 86hrs 21mins 40secs
2. Romain Bardet (Fra/AG2R) +4mins 05secs
3. Nairo Quintana (Col/Movistar) +4mins 21secs
4. Adam Yates (GB/Orica) +4mins 42secs
5. Richie Porte (Aus/BMC Racing) +5mins 17secs
Stage 20 result:
1. Jon Izagirre (Spa/Movistar) 4hrs 06mins 45secs
2. Jarlinson Pantano (Col/IAM Cycling) +19secs
3. Vincenzo Nibali (Ita/Astana) +42secs
4. Julian Alaphilippe (Fra/Etixx - Quick-Step) +49secs
5. Rui Costa (Por/Lampre) +1min 43secs
6. Roman Kreuziger (Cze/Tinkoff) +1min 44secs
7. Wilco Kelderman (Ned/LottoNL) +2mins 30secs
8. Joaquim Rodriguez (Spa/Katusha) +3mins 24secs
9. Daniel Martin (Ire/Etixx - Quick-Step) +4mins 12secs
10. Romain Bardet (Fra/AG2R) Same time
11. Nairo Quintana (Col/Movistar) Same time
13. Adam Yates (GB/Orica) +4mins 14secs
14. Louis Meintjes (SA/Lampre) Same time
18. Geraint Thomas (GB/Team Sky) 4mins 18secs
20. Chris Froome (GB/Team Sky) Same time