The world champion proved the strongest on the uphill finish into Cherbourg-en-Cotentin, passing Julian Alaphilippe (Etixx-Quick Step) at the last.
>> Struggling to get to the shops? Try 5 issues of Cycling Weekly magazine for just £5 delivered to your door <<
The stage win and accompanying time bonus also puts Sagan into yellow for the first time in his career.
He is also leader the green jersey points competition, a lead he may not let slip for the rest of the race, having won the competition every year since 2012.
Sagan did not celebrate his victory as he crossed the line, and it looks as though he was unsure he’d won due to miscommunication about the fate of the breakaway.
He is the first world champion to wear the yellow jersey since Thor Hushovd in 2011, and the first to win a stage wearing the rainbow stripes since Mark Cavendish in 2012.
Sagan’s Tinkoff team set the pace on the final climb, with Roman Kreuziger pushing hard to stop anyone from coming round.
The sprint then got a bit scrappy, and it looked as if Alaphilippe could have got the better of his rivals, but Sagan came through to take the stage and the overall lead.
For stage two of the 2016 Tour de France, all eyes were on Cavendish who was wearing the leader’s yellow jersey for the first time in his career.
It was always an ask for the Manxman to hold the overall lead considering stage two’s closing kilometres, and he finished over a minute down to forfeit the yellow jersey.
Alberto Contador (Tinkoff) lost time to his GC rivals, the cause of which could be his crashes on both stages of the race so far, finishing 48 seconds down on the stage.
Richie Porte (BMC Racing) also saw his GC chances take an early hit as he endured a very slow rear wheel change from Mavic neutral service whilst his rivals disappeared up the road.
As the script demands, a breakaway went away from the peloton early in the stage and those present pedalled their way towards the finish line safe in the knowledge that they’d be overtaken before the end.
In the break were Cesare Benedetti (Bora-Argon 18), Paul Voss (Bora-Argon 18), Jasper Stuyven (Trek-Segafredo) and Vegard Breen (Fortuneo Vital Concept) who had almost seven minutes of an advantage at one moment.
An early talking point on the stage was Contador getting caught up in a crash once again. Unlike stage one, he looked unscathed and once on a new bike was able to ride back to a slowed peloton with the help of a teammate.
André Greipel (Lotto-Soudal) was the best of the rest after the breakaway took most of the intermediate points, showing his desire to be competitive in a competition that has been dominated by Sagan for the last four years.
Benedetti was the first rider to drop off the back of the escape group and his three former companions forged on without his with a three minute advantage with 20km to go.
Watch: Tour de France 2016 stage two highlights
The impetus finally seemed to come into the main peloton with less that 20km left to race, and the three remaining escapees held a lead of 2-47 with 15km to go.
It looked as though the bunch may have left it too late, particularly as the parcours got more technical in the closing kilometres.
The run-in started to look even more treacherous as the rain started to fall on the fast moving riders.
As the breakaway hit the climb with 9km to go the peloton was gaining on them thanks to huge turns from Team Sky riders Luke Rowe and Ian Stannard, motivated by keeping their leader Chris Froome safe.
With 8.4km between him and the finish, and with the polka dot jersey a realistic prospect, Stuyven attacked his breakaway mates and went alone.
The pace on second to last climb climb saw riders left all over the road before the final run in for stage honours really kicked off.
Stuyven hit the summit of the final climb alone but the peloton had him in their sights as he passed under the flamme rouge. He pushed hard right until they passed him with 500 metres to go, where Sagan was able to claim the glory.
Stage three of the Tour sees the riders take on a relatively flat course that should see the sprinters come back to the fore, with a 223.5km course from Granville to Angers.
Tour de France 2016, stage two: Saint-Lô to Cherbourg-en-Cotentin, 183km
1. Peter Sagan (Svk) Tinkoff
2. Julian Alaphilippe (Fra) Etixx-QuickStep
3. Alejandro Valverde (Spa) Movistar
4. Daniel Martin (Irl) Etixx-QuickStep
5. Michael Matthews (Aus) Orica-BikeExchange
6. Wilco Kelderman (Ned) LottoNL-Jumbo
7. Tony Gallopin (Fra) Lotto-Soudal
8. Greg Van Avermaet (Bel) BMC Racing
9. Bauke Mollema (Ned) Trek-Segafredo
10. Chris Froome (GBr) Team Sky at same time
13. Adam Yates (GBr) Orica-BikeExchange
46. Geraint Thomas (GBr) Team Sky at 24 secs
General classification after stage two
1. Peter Sagan (Svk) Tinkoff in 8-34-42
2. Julian Alaphilippe (Fra) Etixx-QuickStep at 8 secs
3. Alejandro Valverde (Spa) Movistar at 10 secs
4. Warren Barguil (Fra) Giant-Alpecin at 14 secs
5. Chris Froome (GBr) Team Sky at 14 secs
6. Greg Van Avermaet (Bel) BMC Racing at 14 secs
7. Nairo Quintana (Col) Movistar at 14 secs
8. Roman Kreuziger (Cze) Tinkoff at 14 secs
9. Simon Gerrans (Aus) Orica-BikeExchange at 14 secs
10. Daniel Martin (Irl) Etixx-QuickStep at 14 secs
21. Adam Yates (GBr) Orica-BikeExchange at 14 secs
46. Geraint Thomas (GBr) Team Sky at 38 secs