Thomas took the overall lead after finishing the mountainous sixth stage in second place behind Ilnur Zakarin (Katusha).
The Team Sky rider held on as Alberto Contador (Tinkoff) attacked him in the long final climb of 15.3 kilometres.
Contador, a two-time Paris-Nice winner, had Thomas in trouble when he attacked strongly about six kilometres from the summit and surged clear.
But Thomas withstood that attack, and another from former Sky teammate Richie Porte (BMC) - now leader of the BMC team - in the last kilometre.
Those efforts cost Thomas as Zakarin clinched his second stage win this year.
Thomas leads second-place Contador by 15 seconds overall heading into Sunday's final stage.
"It's unbelievable. Thankfully I had the legs and I was able to respond to Contador's attacks," Thomas said.
"I'm disappointed not to win the stage. But to gain a little time on Richie and Contador was really good."
Zakarin beat Thomas to the line as both riders clocked the same time of 4 hours, 45 minutes, 11 seconds over the 177-kilometre trek featuring seven climbs.
"The team was super," Zakarain said. "They protected me all day and I just had to give my best in the final climb and it worked."
Contador crossed the line one second behind, with Porte trailing them by seven seconds.
Overnight leader Matthews struggled and dropped down to 49th overall, nearly 20 minutes behind Thomas.
In the standings, Zakarin is 20 seconds behind Thomas in third and Porte is 21 seconds back in fourth.
Porte is the defending champion and, like Contador, has also won Paris-Nice twice.
They will look to attack Thomas - one of Tour winner Chris Froome's most reliable teammates - on another mountainous stage on Sunday.
Stage 7 features four modest climbs before finishing with back-to-back Category 1 climbs - the second-toughest category - up Cote de Peille and Col d'Eze, before a downhill finish to Nice.
"I know the roads well and they're hard racing roads and (there is) a lot more climbing to come. It's by no means finished," Thomas said. "There's still a hell of a long way to go. Hopefully we can defend the jersey. Now I'm going to sleep as much as I can and try to recover."