The Belgian hit the velodrome after 256km with Sebastian Langeveld (Cannondale Drapac) and Zdenek Stybar (Quick-Step Floors), but as they slowed to eye each other up for the sprint, Jasper Stuyven (Trek Segafredo) and Gianni Moscon (Sky) soon joined in.
Stybar made his move too early and the 2016 Olympic champion easily came around the Czech to grasp victory while Langeveld who rode strongly all day, rounded out the podium.
Van Avermaet could not really believe the result despite the 115th cobbled trophy topping off a purple patch since his Olympic gold in September last year.
“At the beginning of my career, I came to the velodrome of Roubaix and I thought it would be impossible for me to win here but ten years later, I've done it," van Avermaet said. "I've worked a lot for that. Every year, I've improved my cycling and finally, I've won it.
"I remained calm and I had a good team on my side at the right time when I had a mechanical. I came across to the best riders without losing too much energy. Daniel Oss did a really good race. It's been a good day for us as a team.
"I did everything I had to do. I was very confident in my sprint. I've won many sprints in small groups. I'm one of the fastest guys, but when two riders came back, Jasper [Stuyven] and [Gianni] Moscon, it changed the strategy.
"Their comeback was not expected, but I did everything well. I had the power to beat Stybar. I'm really happy.
"The Olympic title will always be my best victory but it's very nice to finally have a monument. I've tried for several years to win one. I've believed I could do it. Winning helps to win again."
With 17km left to race, the podium trio emerged on the Carrefour de l’Arbre sector from a six-rider lead group which included Moscon, Stuyven, and Jurgen Roelandts (Lotto Soudal).
About 30 seconds behind dwelled the likes of Peter Sagan (Bora Hansgrohe), 2015 winner John Degenkolb (Trek Segafredo) and Tom Boonen (Quick-Step Floors) in his last Paris-Roubaix and last race as a professional. Sagan who had a tough race after fighting back from two punctures at crucial times soon unhooked.
Just before the often decisive Arenberg sector, Van Avermaet overcame two incidents. He self-serviced a mechanical with 108km to go, after which Australian Paris-Roubaix debutant Miles Scotson ably rode him back to the pack. Six kilometres later he was involved in a minor crash but was able to ride back to the main bunch before the forest.
Van Avermaet's team mate Daniel Oss pulled clear from the main bunch with Stuyven after sector 15 with around 73km to go building a maximum advantage of 30 seconds. With around 36km remaining, Oss was still up the road alone while a larger chasing group of favourites followed behind. But Van Avermaet slipped off the front unnoticed with Stuyven, Moscon, Langevelde, Stybar as Oss fell back to help out his team leader.
While Orica-Scott did not have an ideal race with several punctures and Luke Durbridge's non-serious crash with 175km left to race, defending champion Mathew Hayman appeared several times in chasing groups as if from nowhere and ultimately finished the race in 11th position.
Four-time Paris-Roubaix winner Tom Boonen was the 13th rider to cross the finish in the Roubaix, now ready to face the world in retirement.
“The last few weeks have been a roller coaster of emotions, but I’m telling you that I wouldn’t have imagined such incredible moments this morning," Boonen said.
"These fans are fantastic and I want to thank them for being by my side in the past 15 years. To be honest, I wasn’t thinking of my retirement today, I was all in for the victory.
"It was only at the 5km-to-go mark that I began thinking these are the last kilometers of my career."