Chris Froome kept his composure in a hostile environment as he virtually secured a fourth Tour de France title after extending his overall lead with a good showing in Saturday's 22.5-km time trial through the streets of Marseille.
The Briton was booed by the crowd in the Stade Velodrome -- where the penultimate stage started and ended -- and also in the Old Port and on the climb up to Basilica Notre Dame de la Garde, as he took third place behind two Poles, with Maciej Bodnar winning in 28:15 ahead of Michal Kwiatkowski.
Froome finished six seconds off the pace and five behind his Sky team mate Kwiatkowski, who has been instrumental in his leader's ride to what should be his third consecutive, and Team Sky's fifth, victory in the last six years.
Providing Froome avoids any calamities on the 103-km trek from Montgeron to the capital he will take his Tour haul to four in the last five years -- just one behind cycling greats Miguel Indurain of Spain, Belgian's Eddy Merckx and Frenchmen Bernard Hinault and Jacques Anquetil.
Despite the boos, Froome was gracious.
"The atmosphere here is incredible, it's huge," he said.
While Froome won at least a stage in 2013, 2015 and 2016, he has not raised his arms in celebration this year in a very tight race and has not won a single race this season.
"It's a three-week race and we rode it as such," he said.
Froome, 32, goes on the record as the first person to win three Tours in a row since Indurain who was unbeatable between 1991-95.
American Lance Armstrong won seven Tour titles from 1999-2005 but was later stripped of them for doping.
Colombian Rigoberto Uran overcooked a left-hand corner in the finale but stayed on his bike and leapfrogged Romain Bardet into second place overall to wrap up the Tour with a 54-second deficit.
Bardet had a mediocre time trial but salvaged a podium finish by one second to finish third, 2:20 off the pace, with Froome's Spanish team mate Mikel Landa taking fourth place.
"I gave everything but I was not feeling well today. I rode this time trial with my head, not my legs," said Bardet.
Nairo Quintana, who was targeting a Giro d'Italia-Tour double this season, will finish outside the top 10 after taking second place in Italy.
Briton Simon Yates secured the white jersey for the best under-25 rider.
France's Warren Barguil, who won two stages, will claim the polka dot jersey for the mountains classification and was voted the most aggressive rider in the race.
The top three riders in the general classification were all within 29 seconds of each other going into Saturday's stage but there was little suspense as Froome is a much better time-trialist than Uran and Bardet.