Slovak Sagan, riding the Tour for the first time, won a three-man sprint with yellow-jersey holder Fabian Cancellara and Norwegian Edvald Boasson Hagen.
Cancellara retained the race lead and is seven seconds ahead of Britain's Bradley Wiggins, who finished in the chasing pack along with Cadel Evans.
Pre-stage favourite Philippe Gilbert came home in fourth in the same time.
It was an enthralling finish to what had been a reasonably predictable day with a six-man breakaway escaping as soon as the race started in the Belgian city of Liege.
The sextet led over the first four climbs of the day while the only excitement in the peloton in the opening 170km or so came at the intermediate sprint.
The big points had already been hoovered up by the leaders but nine were on offer for the first man from the peloton to cross the line.
Team Sky's Mark Cavendish was in the hunt but he was outsprinted by former HTC team-mate Matt Goss, who now rides for Australian outfit Orica GreenEdge and had to settle for eight points.
The leaders were eventually caught inside the last 10km as the peloton jostled for position in readiness for the 2.4km ascent to the finish.
Cancellara made the break for victory a third of the way up the climb but Sagan, a sprint specialist, immediately jumped onto his wheel and tracked the race leader up the slope while Team Sky's Boasson Hagen managed to bridge the gap from the chasing bunch.
Liquigas rider Sagan, 22, rejected calls from Cancellara to go past him with 500m remaining, waiting until 50m from the line to sprint past the RadioShack star with Boasson Hagen trailing in third.
"I'm very happy, especially after the incident at the prologue," said Sagan, who almost crashed going round a roundabout during Saturday's opening time trial in Liege.
"My legs were feeling better today. I was the only one who could follow [Cancellara], I was tight behind him. I was just happy to stay on his wheel."
Cancellara, who was wearing yellow for the 22nd day, eight years after first wearing it in Liege, saw the finish slightly differently.
"[Sunday] was more about defending the jersey than winning the stage, and the team did a great job with absolutely no help from other teams," he said.
"I thought attacking would be the best defence and 500m from the line I wasn't going to slow down."
Fast-finishing Belgian Gilbert led home a group that included Team Sky's Wiggins and BMC Racing's Evans and was awarded the same time as the winner, meaning the general classification standings remain largely untouched.
Dave Brailsford, Team Sky's team principal, told: "It was a good effort. All in all, it was important that Brad didn't lose any time."
Cancellara continues to lead Wiggins and Sebastien Chavanel by seven seconds, with Evans 10 seconds further back.
Cavendish sat up in the saddle in the last climb and Brailsford added: "He said he felt good, but once he knew he wasn't going to be competitive, as soon as you know, there's no point emptying the tank for no reason whatsoever.
"It's a different stage finish tomorrow so we'll see some different competitors at the front of the race."