Thomas will become the third British winner of the race, joining Sir Bradley Wiggins and Chris Froome, with the trio winning six of the last seven editions, all in Team Sky colours.
His closest rival at the start of the day, Tom Dumoulin, won the stage by one second from Chris Froome, but with Thomas only 14 seconds back the Welshman had more than enough in hand.
Thomas will carry a lead of one minute and 51 seconds into Sunday’s traditional procession into Paris before the sprinters fight it out for glory on the Champs-Elysees.
Thomas was embraced by his wife Sara and Team Sky principal Sir Dave Brailsford at the finish, and appeared to wipe away a tear.
“I can’t believe it,” he said.
Froome, who came here looking for a record-equalling fifth Tour title and seeking a rare Giro-Tour double, had to settle for third place, taking back the final podium spot from LottoNL-Jumbo’s Primoz Roglic with his second place on the day.
There was brief confusion when the timing splits appeared to show Froome had beaten Dumoulin by one second to take the stage, though it was soon corrected.
“That’s crazy,” Dumoulin said. “I didn’t know anything about split times and I still thought Froome was one second ahead of me when I crossed the line. Wow.”
Thomas emulates Wiggins in converting himself from an Olympic team pursuit champion into the winner of the world’s biggest road race.
The 32-year-old had never before finished in the top 10 of a Grand Tour, though, in his only previous serious attempt to win one, he was forced to withdraw following a crash midway through last year’s Giro d’Italia.
Intermittent rain, the first significant downfall of the entire Tour, created unpredictable conditions on Saturday’s 31km course.
There was one significant scare for Thomas with around 19km to go when the bike almost slipped from underneath him on a right-hand bend.
Thomas may have known he had a buffer to play with, but he was not taking it easy as he was fastest through the first and second splits before grinding up the Col de Pinodieta and dropping back.
Dumoulin had to console himself with his third career Tour stage win – all of which have come in individual time trials.
The Team Sunweb rider’s day did not get off to an ideal start when he could not find his time trial skinsuit in the morning.
But with his clothing sponsor based just across the Spanish border in San Sebastian, an emergency call was placed and they whipped him up a new set of the world champion’s rainbow stripes in time.
Irishman Dan Martin shipped more than two minutes in the time trial, but the UAE Team Emirates rider – named the most combative in the Tour overall – did enough to protect his top 10 place as he is set to finish eighth overall.
Dan Martin finished fourth on Stage 19 of the Tour de France and climbed a place in the overall General Classification to eighth after a hard-fought race that he ended with a punchy sprint finish against his rivals.
It was another afternoon of climbing for UAE Team Emirates as they wrapped up their final day in the mountains at this year’s Tour.
The 200.5km route from Loudres to Laruns took the peloton over no less than six categorised climbs, including two brutal Hors Categorie (HC) mountains.
As the race progressed the peloton began to splinter along the road, with a number of riders attacking off the front during the Col de Tourmalet.
Martin remained true to his game plan, holding his nerve and his power to stick with the yellow jersey group throughout the stage.
After a fast decent off of the final climb, the Irishman showed the gutsy determination he has displayed throughout by contesting a sprint finish, which saw him earn yet another a top-five spot and climb one more place in the GC classification.
The race was won by breakaway rider Primoz Roglic, of Lotto NL Jumbo, in just under five-and-a-half hours.
Commenting on the race, Martin said: “Today we saw a group of very tired men trying to ride their bikes fast. The whole peloton is exhausted after three weeks of racing, but there was still a lot of attacking and aggression.
“It was a pity I didn’t get the stage victory, it was always in the back of my mind and that’s why I held on so hard on the climbs.
“It was a bit dodgy on the downhill with all the mist, but that’s just another dimension of the Tour. Roglic managed to get away on the straight part of the descent [from the Col d’Aubisque] and we just couldn’t pull him back.”
Saturday, the penultimate day of the Tour, sees the riders take to the roads of the Basque country for the Individual Time Trial (ITT).
The 31km route from Saint Pee Sur Nivelle to Espelette isn’t one for the pure time trialists, featuring a lumpy parcours that will favour the punchy riders in the pack.
LottoNL-Jumbo’s Primoz Roglic took victory on Stage 19 by 19 seconds, enough to propel the Slovenian into third place overall, 13 seconds ahead of Froome before Saturday’s decisive time trial.
As has been his trademark on this Tour, Thomas put in a late dig in the final few hundred metres, snatching second place and with it six bonus seconds that extend his lead over closest rival Tom Dumoulin to two minutes and five seconds.
Team Sunweb’s Dumoulin may be the world time trial champion, but Thomas will be confident of defending his advantage on Saturday’s 31km race against the clock which will settle the general classification fight.
This was the stage that worried Team Sky more – a 200.5 kilometres test from Lourdes that included over 5,000 metres of climbing and took on the Aspin, Tourmalet and Aubisque.
Thomas never broke as his rivals prodded and probed, but while he looked comfortable Froome was in danger of cracking on the final climb and it was as much as he could do to finish with Thomas and Dumoulin as Roglic cashed in.
The race came to life at the foot of the Tourmalet, as Ilnur Zakarin of Katusha-Alpecin attacked and drew out Movistar’s Mikel Landa, AG2R La Mondiale’s Romain Bardet and Bora-Hansgrohe’s Rafal Majka.
Sky looked unruffled but over the course of the Tourmalet’s 17km, at an average gradient of 7.3 per cent, the quartet pulled more than two minutes clear, and that advantage only grew as they caught the day’s breakaway on the descent.
Landa was second on the virtual classification at that point, within 80 seconds of yellow, but their advantage would begin to tumble as they started to attack one another on the Aubisque.
As the yellow jersey group closed in, Roglic’s team-mate Steven Kruijswijk and then Dumoulin launched attacks.
Thomas was quick to respond but Froome looked in trouble, at one point dropping a full 30 seconds behind as his legs span furiously and his tongue hung out.
The four-time Tour winner needed the help of the tireless 21-year-old Egan Bernal to pace back on, and as he caught the yellow jersey, Landa and Bardet were being brought back.
A terrifying descent followed as they raced down the mountain in poor visibility. It was in the mist that Roglic attacked, and the former junior world ski jump champion launched himself off the side of the mountain to move into the podium places.
Thomas looked in control as he followed his team-mate down the descent and then pulled ahead in the final few hundred metres, hoovering up six bonus seconds to pad what looks to be a commanding lead.