Fabian Cancellara of Switzerland remained the overall leader for a fourth straight day. The cyclists, who opened in Belgium, completed a 197-kilometre ride from Orchies that featured five small climbs to an uphill finish in the fishing port of Boulogne-sur-Mer.
Sagan, at just 22 one of cycling's brightest stars, won his second stage in his debut Tour by bolting from the splintered pack with less than 300 metres left. He crossed the line several lengths - and one second - ahead of runner-up Edvald Boasson Hagen of Norway and third-place finisher Peter Velits of Slovakia.
Sagan enjoys putting on a show for fans. He churned his arms, as a runner might, in a nod to the title character in the movie "Forrest Gump."
"It's a thing I'd discussed with my teammates about what kind of gesture I'd do on the line," Sagan said of his Liquigas-Cannondale squad, "Everybody said, 'Do a Forrest Gump' because when he was told to run, he ran. And when I'm told to win, I win."
Sagan also showed a humbler side, saying he felt honoured to ride alongside complete riders like Vincenzo Nibali and two-time Giro d'Italia winner Ivan Basso on the Italian squad.
"With Basso, I feel like I'm on the level of someone who would shine his shoes," Sagan said.
Some race watchers simply marvelled at the skill and promise of the young Slovak, who with his Stage 1 victory on Sunday became the youngest rider to win a Tour stage since Lance Armstrong in 1993 — at age 21.
"You've gotta give Sagan credit for the way he's riding at the minute. When you see something like that you just have to stand back and admire it, and smile and say well done," Team Sky manager Dave Brailsford said.
"It's a bit like watching Messi playing football or something isn't it?" he said, referring to Barcelona's Lionel Messi. "He's winning with such apparent ease at the moment that it's pretty phenomenal."
After a time-trial prologue won by Cancellara, and generally flat first few stages, the race is as open as ever. Cancellara has 43 riders within a minute of his overall time — and that's likely to change when the pack heads to the Alps in week two and the Pyrenees in week three, if not sooner.
Tuesday's ride marked the first crash-related withdrawals from this 99th Tour, which ends on July 22 on the Champs-Elysees.
Overall, Cancellara leads Bradley Wiggins, who is hoping to become Britain's first Tour winner, in second and Sylvain Chavanel of France in third — both seven seconds back. Defending champ Cadel Evans climbed one spot to seventh place, 17 seconds behind, and Sagan was 15th, another six seconds slower.
Victoria's Ryder Hesjedal finished 12th in the stage, one second behind Sagan. He moved up from 10th to eighth in the overall standings, 18 seconds behind Cancellara.
Cancellara and the expected Tour title hopefuls trailed Sagan in a 45-rider pack that crossed one second behind the Slovak star — leaving the top standings little changed.
But Belgium's Philippe Gilbert, who last year had 18 victories in all competitions and was the top-ranked rider in the UCI's standings, went tumbling after getting hit from behind. He clambered back onto his bike with scrapes on his left leg and arm and kept going, but lost more time to change a shoe damaged in the crash, said his BMC team manager, John Lelangue.
Gilbert straggled across the finish line 7:46 after Sagan, and plunged to 104th place overall. The Belgian began the day in seventh place, 13 seconds behind Cancellara. Gilbert's slide meant Evans rose a notch.
It was one of at least four crashes that marred the stage as riders jostled to get up front of the nervous pack for climbs near the finish — including one within the last kilometre. Some riders also had mechanical troubles and flat tires.
"The group was nervous. Everyone wanted to be up front," Sagan told France-2 TV. "There were a lot of crashes ... it was a very dangerous stage."
Five breakaway riders got out early through northern France's wheat fields and former steel industry hubs, and through medieval villages like Isbergues - named for a sister of Charlemagne who, legend has it, could cure skin and eye illnesses.
With about 50 kilometres to go, several riders crashed in a flat portion of road through a wheat field in a slight turn.
Sky's Kanstantsin Sivtsov, of Belarus, became the first competitor to drop out this year. A Tour medical report said he broke his left shin, and was looking at surgery.
Rabobank gregario Maarten Tjallingii broke his left hip in the same accident but finished the stage. Richard Plugge, a team spokesman, said Tjallingii was taken to a hospital in Abbeville where the fracture was diagnosed. The lead-out rider for Rabobank sprinter Mark Renshaw was being taken to hospital in Amersfoort, the Netherlands on Tuesday for surgery, Plugge said.
Some 30 kilometres later, another crash sent riders flying off the shoulder of the road on both sides; one flew into a wire fence. Spain's Jose Joaquin Rojas of Movistar clambered into an ambulance and dropped out. He was hospitalized with a broken collarbone, the medical report said.
That second big spill split the pack into mini bunches, and the front group overtook the breakaway riders.
U.S. sprint specialist Tyler Farrar went down in the first crash and was delayed in the second. He and several of his Garmin-Sharp teammates rallied together to rejoin the main pack.
Wednesday's fourth stage takes riders on another bumpy ride along several hills, a 215-kilometre leg from Abbeville to Rouen in the heart of Normandy.
AP writer Greg Keller contributed to this report.Suggest a correction