Chris Froome and Alberto Contador both had nearer misses on the descent into Gap but the Briton retained his overall lead on stage 16 of the 100th Tour de France.
While Rui Costa was racing away to a solo victory up ahead, Contador had launched a series of attacks on Froome on the ascent of the Col de Manse and continued to push the pace on the way down to the finish.
But the Spaniard almost overcooked it on one corner and Froome followed him into the roadside gravel immediately behind.
Bauke Mollema, who splits the two men in the general classification, went up the road ahead as they recovered, but Froome and Contador were able to catch up by the finish - with Froome admonishing the Spaniard for not doing his share of the work on the way.
Costa had attacked on the final climb of the day after being part of a 26-man breakaway who had led almost all the way from Vaison-la-Romaine.
He crested the Col de Manse 50 seconds clear, and beaten nearest challengers Christophe Riblon, Jerome Coppel and Arnold Jeannesson to the finish by 42 seconds.
Ireland's Nicolas Roche finished in 16th place, 1m26s off the lead having initially been part of the 26-man breakaway. While his compatriot Dan Martin finished back in 43rd spot, 12m8s back.
Martin lies tenth overall in the general classification, 9m28s off the yellow jersey. Roche lies in 34th place overall, 40m12s behind Froome.
A largely uneventful stage - dominated by that early breakaway - had been notable only for a train delaying the peloton at a level crossing until they came to the Col de Manse, the category two climb that has a history of adding drama to stages around Gap.
Local authorities had doused the road with water near the summit, remembering all too well how Joseba Beloki crashed here on melting tarmac while battling Lance Armstrong for the yellow jersey in the 2003 Tour.
There was nothing quite like that today, but the general classification picture might have changed significantly had Contador and Froome not been quite so quick on the brakes.
Contador and his team-mate Roman Kreuziger, fourth in the general classification, launched a series of attacks in tandem on the way up, and briefly succeeded in dropping Richie Porte to leave Froome isolated, although the Tasmanian just as quickly recovered.
Contador went on the attack again on the descent and had pulled ahead before almost coming off entirely on a sharp right-hander.
Froome went the long way around the outside and had both wheels on the gravel before clipping out, while Contador remounted behind.
Porte dropped back to help them recover and they succeeded in catching Mollema before the finish, maintaining Froome's lead of four minutes 14 seconds over the Dutchman, with Contador 11 seconds further back.
The same climb had decided the stage win too.
The breakaway, which featured the likes of world champion Philippe Gilbert, serial escapee Thomas Voeckler and Ireland's Nicolas Roche, began to splinter on the way up.
Sojasun's Jean-Marc Marino and Blel Kadri had both attacked off the front even before they got there, leading by 20 seconds as they passed through Gap for the first time.
But they were soon caught as Michael Albasini and Adam Hansen made moves of their own.
Hansen briefly went clear, but Costa and Jerome Coppel were the next to attack, with Costa easing away to take what proved a decisive lead.
Earlier, there was an unscheduled break for the peloton when they were stopped at one of the three level crossings along the stage.
The delay cost them a little over 20 seconds but the Tour's competition director Jean-Francois Pescheux declared the matter an "incident of the race" with no adjustments to be made to the timing.
However, it did allow the break to increase their lead to more than 10 minutes and ensured - if it was not already clear - the stage winner would come from among their number.