Bora-Hansgrohe’s Peter Sagan was second and Katusha-Alpecin’s Marcel Kittel third.
Defending champion Chris Froome was in a crash with just over 5km left and lost a considerable amount of time. The Team Sky rider ultimately crossed the line 50 seconds behind Gaviria.
The 201km stage included an intermediate sprint after 119.5km, at La Tranche-sur-Mer.
Jerome Cousin of Direct Energie came out on top, with Fortuneo-Samsic’s Kevin Ledanois second and Yoann Offredo (Wanty-Groupe Gobert) third.
The nearly pan flat stage also included a category four Cote de Vix (0.7km at 4.2%) 28km from the finish. Ledanois was first over the climb, earning himself the polka dot jersey.
With just over 17km remaining, AG2R’s Oliver Naesen attacked from the front of the peloton. He was 20 seconds behind the leaders, Cousin and Offredo.
With 13.5km left, the riders encountered the first of the new time bonus sprints at Maillezais. Cousin won it and claimed three bonus seconds. Offredo was second over the line and took two seconds, and Naesen took third, earning one bonus second.
With 13km remaining, the peloton cut the gap to 12 seconds and soon they were within touching distance of the leaders.
They caught up 9km from the finish line and Quick-Step’s Philippe Gilbert set the pace at the front.
Bob Jungels (Quick-Step) led the front group for a while, but his teammate Yves Lampaert took over in the last kilometre, with Maximiliano Richeze and Gaviria on his wheel.
Richeze led out the sprint, followed by Gaviria and Sagan before Gaviria crossed the line first.
“It’s an incredible day for me and for our team. We were ready for it, ready for the sprint,” said the stage winner.
“The yellow jersey is one that everyone dreams of wearing and to get it on the first day is amazing. I’m so happy to wear it and we’ll try to keep it as long as we can.”