The Dutchman was seventh going into this stage only 13 seconds behind Van Avermaet but will now be a minute behind.
Sensing the danger, overall contenders Richie Porte of BMC and Sky's Geraint Thomas were the first of many to unsuccessfully try to close Martin down. By the time 200 meters was coming, Valverde went, and I knew I wasn't going to beat him for third.
Martin came home second the last time a Tour stage ended in Mur de Bretagne three years ago and he admitted he had been obsessed about winning here this time on a punchy climb that suited his abilities.
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).
Martin is now 21st overall, one minute and 30 seconds off the lead which is still held by Belgium's Greg Van Avermaet.
"(Porte) can be confident after this climb, " Van Avermaet said.
Title hopefuls Tom Dumoulin (Sunweb) and Romain Bardet (AG2R La Mondiale) were the big losers of the day. Both men could not hold the pace of stage victor Dan Martin (UAE Team Emirates). Dumoulin is one more second behind. It's never good to lose time, " said Bardet, who has finished on the podium in the past two Tours.
Another batch of valsartan recalled over carcinogenic concerns
Mina Tadrous, (pharmacy faculty, University of Toronto), explained that valsartan is a common drug used by people with high blood pressure.
Cavendish is chasing five-time Tour victor Eddy Merckx's record of 34 Tour stage wins, and the Dimension Data sprinter's running tally now stands at 30.
Martin was one of several team leaders along with former Tour victor Vincenzo Nibali and two-time runner-up Nairo Quintana who were caught off-guard by an attack by Quick-Step 100 kilometers into the stage during a straightaway that was exposed to crosswinds.
While they fought back to join the chase group, a third group led by Lotto and their rider Primoz Roglic struggled to stay in touch.
A four-man breakaway earned a seven-minute advantage before being swallowed up late. While that Alp ascent awaiting on Stage 12 rises to 1,850 meters, the Mur de Bretagne tops out at 293 meters.
Both title hopefuls were left behind by the rest of the top riders as they increased the pace hunting for the win that finally went to Daniel Martin of Ireland.
Saturday's (NZ time) flat 231-kilometer leg from Fougeres to Chartes is the longest stage of this Tour.