The world champion proved the strongest on the uphill finish into Cherbourg-en-Cotentin, passing Julian Alaphilippe (Etixx-Quick Step) at the last.
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
Winter nutrition: How to fuel your fire
Getting the most out of your winter training means making sure you are optimally fuelled for every ride. Joe Laverick investigates the specific demands of cold season nutrition
By Joe Laverick •
Week in Training: How Tom Bell prepared for the National Hill-Climb Champs
The reigning champion talks us through his final week of training ahead of the main event
By David Bradford •
Peter Sagan explains the injury that saw him abandon the Tour de France 2021
The seven-time points jersey winner crashed on stage three and never fully recovered
By Tim Bonville-Ginn •
Peter Sagan set to sign for Team TotalEnergies after Tour de France, according to report
The former world champion is also set to bring Specialized and a group of riders and staff members with him
By Tim Bonville-Ginn •
Peter Sagan confirmed to target eighth green jersey at Tour de France
Sagan will share leadership roles with Wilco Kelderman
By Chris Marshall-Bell •
Peter Sagan says Wout van Aert should apologise over Tour de France sprinting incident
Peter Sagan says Wout van Aert should apologise for his reaction to a sprinting incident during the 2020 Tour de France.
By Alex Ballinger •
'We will go full gas for Peter': Bora-Hansgrohe prepare final assault on Tour de France green jersey
Peter Sagan faces not winning the green jersey for only the second time since 2012
By Jonny Long •
Peter Sagan shares his thoughts on sprint controversy after stage 11 of Tour de France 2020
Peter Sagan has shared his thoughts on the sprint controversy after stage 11 of the Tour de France 2020.
By Alex Ballinger •
Wout van Aert tried to speak to Peter Sagan after stage 11 ‘but the only thing that came back was strong words’
Wout van Aert says he tried to speak to Peter Sagan after their incident of stage 11 of the Tour de France, but he only received “strong words” in response.
By Alex Ballinger •
Five talking points from stage 11 of the Tour de France 2020
More on the Sagan and Van Aert drama, late attacks and a deserved Ewan win - these are the big moments from the day
By Stephen Puddicombe •