The BMC rider was out the front from the 21st kilometre, firstly with eight riders, then just with fellow Belgian Thomas de Gendt (Lotto Soudal).
Van Avermaet attacked his long range breakaway companion on the penultimate Col du Perthus climb with 17kms to go, crossing the line two minutes and 24 seconds ahead.
"I felt pretty good. Me and Thomas were the strongest guys from the break and having made the race hard and the gap big we knew the peloton would not come back. I went on my own because I was strong enough."
With overnight race leader Peter Sagan (Tinkoff) cracking somewhere back on the Pas de Peyrol and over five minutes to third placed Rafal Majka (Tinkoff) and the overall favourites group, the yellow jersey was Van Avermaet's.
"The yellow jersey I was never dreaming about but it's a big dream come true.
"I was happy with the stage win last year now a stage win and the yellow jersey is a once in a lifetime for me and I will enjoy it as much as possible tomorrow."
It's Van Avermaet's second Tour de France stage win after out sprinting Peter Sagan on stage 13 in Rodez last year.
The general classification: shaken not stirred
The medium mountain stage was always expected to sort the sprinters from the GC men rather than cause an overall classification upset, but it was a chance for teams like Sky and Movistar to show off their form.
Movistar drove the peloton hard up the Pas de Peyrol causing damage to the bunch but not to the favourites. Sky then swapped roles to guide the favourite group up the Col du Perthus.
Sky however should be concerned about Mikel Landa and his ability to assist Chris Froome in the high mountains after dropping out the back on the Peyrol climb.
In the closing moments on the Col de Font de Cere before the descent into Le Lioran, Romain Bardet (AG2R-La Mondiale) tried his luck drawing Alejandro Valverde (Movistar) and team leader Nairo Quintana. The trio eked out a slight gap but Sky rallied to bring it all back together.
Alberto Contador (Tinkoff) clearly struggled with his injuries falling back from the group of favourites on both the Col de Perthus and Col de Font de Cere climbs. Never one to give up, the Spaniard almost regained contact but still finds himself one minute and 21 seconds behind 2015 Tour winner Froome.
As it happened
After a string of attacks from the stage start, Cyril Gautier (AG2R-La Mondiale), Serge Pauwels (Dimension Data), Majka, Andriy Grivko (Astana), Bartosz Huzarski (Bora-Argon 18), Romain Sicard (Direct Energie), Florian Vachon (Fortuneo-Vital Concept), De Gendt and Van Avermaet made something stick at the 21st kilometre.
With around 93kms to go, Grivko, Van Avermaet and De Gendt sauntered off the front. By around the 148th kilometre, the trio had gained a 15 minute advantage on the peloton and around two minutes to their former breakaway group. This gap dropped rapidly once they reached the foot of the Peyrol and 1.8 kilometres from its summit the Belgians lost Grivko.
De Gendt moved into the polka dot jersey after claiming the maximum points on the Cote du Puy Saint-Mary, Col de Neronne and the Pas de Peyrol climbs.