Britain's Chris Froome thought it was "game over" in his bid to win a fourth Tour de France title when his bike had a mechanical issue on stage 15.
The Team Sky rider lost almost a minute to his rivals after he was forced to swap his rear wheel with Polish team-mate Michal Kwiatkowski on Sunday.
However Froome, 32, recovered to rejoin the group of favourites and retain the leader's yellow jersey going into the final week of the Tour.
"That was a huge save," said Froome.
"I'm really grateful to have got through Sunday because it was touch and go if I was going to make it back."
Team Sky had been in control of the peloton before reaching the foot of the steep Col de Peyra Taillade climb inside the final 40km.
Third-placed rider Romain Bardet and his AG2R La Mondiale team then burst clear, distancing Froome and it was around this point the Briton encountered his wheel problem, initially reported as a puncture before the rider himself later said was a broken spoke.
"There were a good five to 10 minutes where, knowing the pace that AG2R were setting going into the climb, I thought that was potentially game over for me," Froome told Eyes On Events Radio 5 live.
"If I hadn't had reached that front group by the top of that climb then I don't believe I would've made it to the finish line in yellow."
Following Monday's rest day, there are six further stages, including a summit finish on Thursday's stage 18 and a time trial on Saturday's stage 20, with the race ending in Paris on Sunday.
Froome, who is bidding to win his third straight Tour title, leads Italy's Fabio Aru (Astana) by 18 seconds, with Frenchman Bardet five seconds further behind.
Colombia's Rigoberto Uran (Cannondale-Drapac) is 29 seconds behind Froome in fourth, with Ireland's Dan Martin (Quick-Step Floors) at one minutes 12 seconds down in fifth, making it the closest Tour at this stage in history.
"We knew coming into this year's race that it would be the closest-fought Tour I've ever done and the biggest challenge of my career to date. And it's shaping up to be exactly that," said Froome.
The Kenya-born Briton added it was a "disappointment" to lose the yellow jersey to Aru when he cracked on the final climb of Thursday's stage 12 before reclaiming it on Saturday's stage 14, but was feeling "better and better" as the race enters its final week.
He added: "I came in really fresh and I hope that means going into the third week that'll put me in better shape than some of my rivals."