Team Sky had laid down the gauntlet with a strong effort, but having recorded an identical time over the first 13 kilometres, BMC were six seconds ahead as they passed through the second checkpoint.
The Welshman nicked third place in the bonus sprint late on the stage to move one second clear of the rest of the main contenders, and he will hope for Team Sky victory in Monday's team time trial to propel him into yellow.
Van Avermaet, a Belgian who excels at single-day classics, isn't a threat for the overall title but he could keep the lead through the cobblestoned Stage 9 ending in Roubaix.
Boulder's Taylor Phinney, on the other hand, finished 19 in the stage, just a second behind Froome.
Rigoberto Uran's EF Education First-Drapac team gave up 35 seconds in fifth, Mikel Landa and Nairo Quintana's Movistar 54 seconds in 10th, and Vincenzo Nibali's Bahrain-Merida team 66 seconds in 11th.
"It's amusing because at the end of the day it's just another bike race".
"They were the second to last team and they had a great ride".
The three-time defending world champion took the overall lead of the Tour on Sunday after he bettered about a dozen other sprinters to win Stage 2.
Midway around the course first Luke Rowe and then Wout Poels dropped off the back of their train, and it perhaps proved key as BMC carried more speed through the second half of the course.
"One day you gain, one day you lose". "We didn't plan where or whatever but we knew the time was taken on the fourth guy over the line".
"It was a huge challenge for the team, it's been incredible for us", said the 33-year-old Briton who was jeered when his name was announced on the starting ramp. "It's been a great little journey over the past couple of months to come to this team and become part of a really tight team time trial unit and to really add to that is something I will be proud of for a long time", he said.
"Fernando won yesterday and now I'm the one with the yellow jersey, it's been exciting". That would have been a nice bonus on top. It was a good test for us and the team. "It just shows that we are here, too, and let's get it on". "We were close but not quite quick enough".
For Porte, the stage win took on special significance as it marked a year since he crashed out of last year's Tour on the decent into Chambery on the ninth stage.
Porte may be linked with a switch to the American Trek-Segafredo team next year, but the future of other riders and team staff is uncertain; and in the biggest race of the year, Monday's victory was the medicine they all collectively needed to reaffirm their overriding goal of reaching the finish as the team of the 2018 Tour victor. The rider was the fastest in a very reduced group that resulted after a last-kilometres crash.