The world champion was able to avoid a crash in the final 2km that took down the yellow jersey and stage one winner Fernando Gaviria (Quick-Step) and split the bunch.
Other sprinters Arnaud Démare (Groupama-FDJ), Sonny Colbrelli (Bahrain-Merida), Alexander Kristoff (UAE Team Emirates) and André Greipel (Lotto-Soudal) were also able to make it into the select front group with Gaviria's team-mates Julian Alaphilippe and Philippe Gilbert.
As the finish approached, Alaphilippe tried to jump away, but couldn't get clear of the fast men. Démare was the first to open up his sprint on the right of the road, but was tracked by Sagan who came round him within the final 50m and held his speed towards the line.
Colbrelli looked to be gaining on him, but ran out of road and was unable to stop the rainbow jersey from claiming his first win of the Tour after his second place on stage one.
The GC contenders finished safely in a group together to leave time gaps as they were ahead of the crucial team time trial on Monday's stage three. Despite Movistar's Alejandro Valverde being able to match the sprinters and finish seventh on the stage, the Spaniard wasn't able to gain any time after riders in the bunch were given the same time due to the crash within the final 3km.
How it happened
The peloton set off on another blisteringly hot summer's day from Mouilleron-Saint Germain, hoping the flat 182.5km second stage would play out in a more straightforward manner than stage one's hectic finale.
Three riders set off in the breakaway as the flag dropped, with Sylvain Chavanel (Direct Energie), Dion Smith (Wanty-Groupe Gobert) and Michael Gogl (Trek-Segafredo) the trio who went out front.
They gained almost three minutes ahead of the only categorised climb with just under 30km gone, with New Zealander Smith taking the solitary point atop the fourth category Côte de Pouzages. He took the polka dot jersey at the end of the stage thanks to staying above Fortuneo-Samsic's Kevin Ledanois who took stage one's only KOM point.
Smith seemed content with his day's efforts at that point, with little interest in forging out front in the sun for the rest of the day. Gogl meanwhile was forced to drop to the medical car for treatment, leaving veteran Frenchman Chavanel out alone.
The 39-year-old seemed determined to commit to the break, and began to pull the gap out further, gaining a maximum gap of around 4-30.
The peloton were content to let Chavanel ride alone off the front, and began to close in on him within the final 50km.
His gap was down to two minutes with 40km to go as Quick-Step and Dimension Data worked towards the front, but he admirably held out to around 14km to before getting caught as fatigue well and truly set in.
Behind, there were several crashes on another nervous day in the bunch. Tsgabu Grmay (Trek-Segafredo) was forced to abandon at the feed stop with "intense abdominal pain" according to his team, while Luis Leon Sanchez (Astana) also abandoned after crashing into a traffic island shortly after 40km to go.
Adam Yates (Mitchelton-Scott) crashed inside final 30km and was forced to make a bike change before catching back on, while stage hopeful Arnaud Démare made a wheel change with 23km to go.
Marcel Kittel (Katusha-Alpecin) suffered an extremely untimely puncture with 7.6km to go, taking a bike change but dropping out of contention for the stage win.
The action really ramped up in the final 4km as the peloton approached the finish, with Quick-Step taking charge on the front heading into the right turn with 2km to go.
But they were out of luck as their sprinter Gaviria was caught up in a crash on a sharp right-hand turn, with the lead group of sprinters able to get away and contest the finish.
Monday's stage three will see the riders take on the team time trial stage, with a 35.5km route from Cholet.
Tour de France 2018, stage two: Mouilleron-Saint Germain - La Roche-Sur-Yon (182.5km)
1 Peter Sagan (Svk) Bora-Hansgrohe, at 4-06-37
2 Sonny Colbrelli (Ita) Bahrain-Merida
3 Arnaud Demare (Fra) Groupama-FDJ
4 Andre Greipel (Ger) Lotto Soudal
5 Alexander Kristoff (Nor) UAE-Team Emirates
6 Timothy Dupont (Bel) Wanty-Groupe Gobert
7 Alejandro Valverde (Esp) Movistar Team
8 Andrea Pasqualon (Ita) Wanty-Groupe Gobert
9 John Degenkolb (Ger) Trek-Segafredo, all same time
10 Philippe Gilbert (Bel) Quick-Step Floors, at 8s
General classification after stage two
1 Peter Sagan (Svk) Bora-Hansgrohe, in 8-29-53
2 Fernando Gaviria (Bel) Quick-Step Floors, at 6s
3 Sonny Colbrelli (Ita) Bahrain-Merida, at 10s
4 Marcel Kittel (Ger) Katusha-Alpecin, at 12s
5 Sylvain Chavanel (Fra) Direct Energie, at 13s
6 Philippe Gilbert (Bel) Quick-Step Floors, at 14s
7 Geraint Thomas (Gbr) Team Sky, at 15s
8 Oliver Naesen (Bel) AG2R La Mondiale, at 16s
9 Alexander Kristoff (Nor) UAE Team Emirates
10 John Degenkolb (Ger) Trek-Segafredo, at same time
Thank you for reading 20 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1