The Spaniard was Chris Froome's right-hand man in the mountains and looked strong on the Izoard climb, launching an attack which ultimately came to nothing.
The Briton suffered a few hiccups, but was always in control over the three-week race
The Team Sky rider extended his lead to 54 seconds going into Sunday's 21st stage, largely a processional ride to Paris.
Froome kept hold of the race leader's yellow jersey ahead of Saturday's decisive time-trial in Marseille
Froome finished fourth, giving up four bonus seconds to Romain Bardet but putting two more into Uran.
Meanwhile German sprint king Marcel Kittel pulled out before the halfway point of the stage after crashing in the first 20km.
Chris Froome retained the overall lead in a hectic finale to stage 16.
Dutchman Bauke Mollema won the 189.5-km stage from Laissac-Severac L'Eglise
Chris Froome retook the yellow jersey from Fabio Aru.
Another Sky rider Mikel Landa also has emerged as a potential Tour winner.
Aru takes yellow from Froome
Dutchman Dylan Groenewegen finished second with Edvald Boasson Hagen of Norway third.
Britain's Chris Froome retained the overall leader's yellow jersey.
Champion Chris Froome retained the yellow jersey after finishing the stage third.
Thomas was second overall at the start of the day, just 12 seconds behind reigning champion and his Sky team leader Froome.