The Etixx-QuickStep man came into the stage 17 seconds down on overnight leader Chris Froome (Team Sky) but went on the attack in the closing kilometres of the journey from Vielha in the Spanish Pyrenees to his adopted home of Andorra-Arcalis.
Martin was 14th across the line in his group of six, all of whom must now be regarded as the front-runners for the yellow jersey in this year’s race.
Among that sextet were race leader Chris Froome (Team Sky), Adam Yates (Orica-BikeExchange), Nairo Quintana and Alejandro Valverde (Movistar) and Richie Porte (BMC Racing Team).
Martin dislodged Joaquim Rodriguez (Katusha) in third and now trails two-time race winner Froome by 19 seconds going into the first of two rest days today.
Dutchman Tom Dumoulin (Giant-Alpecin) claimed a superb win having emerged strongest of the early breakaway, but the real fireworks were going off in the general classification group further back the road.
The first major attack came from two-time Tour champion Alberto Contador (Tinkoff) who went clear with a select few others inside 20 kilometres but the peloton simply ramped up the pace and reeled him back in.
It was to be the Spaniard’s last act in this Tour as he soon abandoned, blaming a fever he’d been battling the last few days along with the injuries he sustained in a dreadful opening stage crash.
In contrast, Martin kept his powder dry and remained towards the front of the race as Froome’s band of lieutenants set a blistering tempo.
It was a tactic that clearly worked as coming to the base of the final climb the peloton was down to 25.
Martin began to show his teeth here and keen to thin the group out even further he accelerated a number of times.
However, he looked like the ploy might backfire as he appeared in serious trouble with a couple of kilometres to go when he tailed off the back of Froome’s group.
But he somehow found the strength to stay in touch as the heavens opened and a gun-metal grey sky emptied its contents on the riders.
And when Martin sensed the time was right he put the boot down and jumped clear, only to be reeled in by subsequent attacks from those in that front group.
The counter-attacks that followed had Martin in difficulty again but he dug deep and summoned the strength to haul himself back onto the tail-end of the group as they crossed the line.
It means his Tour de France dreams remains alive as the riders head into the first rest day of this year’s race today.
He’ll have a chance to gather himself before hostilities resume tomorrow and a few easier days are expected before Thursday’s showdown to Mont Ventoux.
For the other Irish rider in the race, Sam Bennett, it was another savage test and he finished in the group almost 40 minutes down.
He is now last overall but he is still in the race and to get this far, given his condition, is an incredible achievement in itself.