Dylan Groenewegen (LottoNL-Jumbo) won stage seven of the Tour de France, dominating a bunch sprint after nearly six hours in the saddle.
Martin, whose other career Tour stage win came in Bagneres-de-Bigorre in 2013, had finished second on this climb when it featured in the 2015 Tour and timed his attack to perfection, launching off the wheel after the Australian had made his own move and riding clear.
Irish rider Martin broke with one kilometer remaining on the final climb with French rider Pierre Latour offering the only competition.
It was a heart-thumping finale that immediately had Martin thinking of wife Jess, who was watching at home and is expecting twins in October.
"But there's a great feeling in the bus now, laughing and joking and this win is for them, they really looked after me".
This group was also reeled back in and the next one to attack was Yoann Offredo (Wanty-Groupe Gobert), who got a lead of more than seven minutes over the peloton.
BMC rider Porte, Italian Vincenzo Nibali and Britain's Geraint Thomas all crossed the line three seconds off the pace after the 181-kilometre ride from Brest to Mur de Bretagne, with defending champion Chris Froome five seconds further back.More news: Tropical Storm Chris Turning Into Hurricane Off North Carolina Coast
Ultimately, it paid dividends, even if he admitted afterwards to being anxious for a brief period. The narrow and tight turn into the finish and then the rise should see him in his element and he could win it before the last 150 metres. "I'll try my best to win but you saw all that today".
"But when I went to go, Quick-Step and Bora have just got a different kind of level of top speed". I was a bit nervous because of the headwind.
"So I set off, kept my head down, kept going and my legs felt good".
"I was afraid of the crosswinds and maybe it was adrenaline but the legs were there and it all worked out".
Belgian Greg Van Avermaet retained the leader's yellow jersey ahead of Saturday's eighth stage and said he hopes to go to the mountains with it next week after what he described as a relaxing day.
Joining Porte in those time gains was Irish stage victor Daniel Martin (UAE), Spaniards Alejandro Valverde (Movistar) and Mikel Landa (Movistar), Briton Adam Yates (Mitchelton-Scott), Welshman Geraint Thomas (Sky), Colombian Nairo Quintana (Movistar), Italian Vincenzo Nibali (Bahrain-Merida), and Dane Jacob Fuglsang (Astana).
AG2R's Romain Bardet cracked in the heat of the final ascent and lost 31secs, while fellow contender Tom Dumoulin (Sunweb), the 2017 Giro d'Italia champion, lost almost a minute after suffering a mechanical problem.