Cavendish moves level with Andre Leducq in third place on the Tour's all-time list of stage winners behind Eddy Merckx (34) and Bernard Hinaut (28).
Graham JonesRadio 5 live sports extra co-commentator
"It was a quite remarkable stage overall and it was an intelligent ride from Mark Cavendish, who seemed to be in the right place at the right time for the bulk of the day. He judged the conditions and the team plan was perfectly executed.
"That he now has 25 stage wins - the joint third most in Tour de France history - serves to emphasise that he is rightfully considered among the best cycling has ever seen.
"I think Team Sky will be a little bit worried with Chris Froome's lead at the top under threat. Alberto Contador took his chance and he's in the mix.
"Edvald Boasson Hagen was a big miss for Team Sky and he would have made a big difference in this stage. They need a positive response now."
The Great Britain rider, whose Omega Pharma-QuickStep team were the first to attack after just 60km of the 173km race that began in Tours, said afterwards: "It was an incredible day. We talked about it and we knew the wind was strong. (Team-mate) Gert Steegmans just went for it and it just kicked off.
"I nearly missed the Contador attack. Michel Kwiatkowski got me across and I just sprinted - I just managed to get on. With an echelon (the diagonal formation riders adopt in the road to deal with crosswinds) it is like saving yourself after falling through ice - you have got five seconds to make it, otherwise it is over.
"It wasn't easy but my team-mates rode out of their skin and it was incredible to be able to win it. I knew if I stayed behind Sagan I would be able to get it, and that is what I did."
Cavendish also picked up 45 points in the green points jersey standings for winning the stage, to add to the 17 points he won in the intermediate sprint. However, he is still 84 points behind classification leader Sagan.
The duo were the only recognised sprinters left in a group of 14 riders who raced clear towards the finish in Saint-Amand-Montrond after German duo Marcel Kittel and Andre Greipel were caught out in the crosswinds.
Kittel, who has won three sprint finishes, was the first to be distanced when Cavendish's team accelerated and once they realised they had cut the Argos-Shimano rider off, they kept the pace high to stop him getting back on.
Greipel was likewise dropped when Contador's team attacked in the closing stages - a move that was covered by Cavendish and Mollema but caught out Froome and Team Sky.
Most Tour de France stage wins
(Bel) 1969 to 1975
(Fra) 1978 to 1986
(Fra) 1927 to 1935
(GB) 2008 to present
British riders Ian Stannard and Geraint Thomas were among Froome's team-mates who tried to close the gap but once they ran out of steam it was all about limiting losses.
"It was another reminder that we've got to be on our toes the whole time on stages like this which look easy on paper," said the race leader.
Saturday's 14th stage is a hilly 191km race from Saint-Pourcain-sur-Sioule to Lyon which features seven categorised climbs, although none is mountainous.
Results of stage 13:
1. Mark Cavendish (GB) Omega Pharma - Quick-Step 3:40:08"
2. Peter Sagan (Svk) Cannondale same time
3. Bauke Mollema (Ned) Belkin
4. Jakob Fuglsang (Den) Astana
5. Niki Terpstra (Ned) Omega Pharma - Quick-Step
6. Roman Kreuziger (Cze) Saxo - Tinkoff
7. Alberto Contador (Spa) Saxo - Tinkoff
26. Chris Froome (GB) Team Sky +1:09"
70. Alejandro Valverde (Spa) Movistar +9:54"
Overall standings after stage 13:
1. Chris Froome (GB) Team Sky 51:00:30"
2. Bauke Mollema (Ned) Belkin +2:28"
3. Alberto Contador (Spa) Saxo - Tinkoff +2:45"
4. Roman Kreuziger (Cze) Saxo - Tinkoff +2:48"
5. Laurens ten Dam (Ned) Belkin +3:01"
Green points jersey standings after stage 13:
1. Peter Sagan (Svk) Cannondale 357
2. Mark Cavendish (GB) Omega Pharma - Quick-Step 273
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.