Sagan’s foot came unclipped from his pedal as he started to accelerate at the finish, but he kept his calm and still proved too strong for the competition at the end of the 212.5km run from Verviers in Belgium.
Britain’s Geraint Thomas was well placed in the finish to keep hold of the race leader’s yellow jersey.
His team leader and reigning champion Chris Froome also finished amongst the front-runners and moved up from sixth to second, still at 12sec.
Australian Michael Matthews was second on the stage with Dan Martin of Ireland third, just ahead of Olympic champion Greg Van Avermaet in fourth.
Matthews moved up to third overall on the same time as Froome with Sagan fourth a second further back.
The 1.6km long uphill finish to the stage was tailor-made for Sagan and the world champion didn’t disappoint, proving his power despite his minor problem.
The 50 points for winning also put him into contention to claim the sprinters’ green jersey.
He has won that in each of the last five years, although he had only once before failed to claim the jersey by the third stage.
German Marcel Kittel still has that ahead of Tuesday’s flat fourth stage that will favour pure sprinters.
American Nathan Brown took enough points over the day’s five climbs to snatch the polkadot king of the mountains jersey from his compatriot and team-mate Taylor Phinney.