SARZEAU, France — Colombia’s Fernando Gaviria won for the second time in four stages at the Tour de France on Tuesday, while Olympic champion Greg Van Avermaet kept the yellow leader’s jersey.
Gaviria won Stage 4 after edging world champion Peter Sagan in a sprint finish to the flat 195-kilometer (121-mile) leg from La Baule to Sarzeau that started and finished on the Atlantic coast.
The 23-year-old Gaviria had already won Stage 1 — when he also edged Sagan — on his Tour debut for his Quick-Step team.
‘‘It was a very difficult sprint, but we knew how to pull it off,’’ Gaviria said. ‘‘I had to spend all my energy because it was a demanding finish. We are happy to have won it because the team deserved it.’’
Defending champion Chris Froome of Sky, who remained 55 seconds back because of his fall in Stage 1, finished safely in the pack with leader Van Avermaet.
Quick-Step hunted down the breakaway to set up Gaviria, who powered his way down the final meters of the 4-kilometer finish — the longest straightaway to conclude a leg on this Tour.
Gaviria surged across the line just inches ahead of the hard-charging Sagan, who was trying to add to his Stage 2 win, and Andre Greipel in a close third.
‘‘He is faster than me,’’ Sagan said of Gaviria. ‘‘We will see. Maybe I will wait for some mistake. And maybe we will see the next days on the climbs. Every stage is different, every sprint is different.’’
Riders were enjoying a calm sunny afternoon in the cycling hotbed of northwest Brittany until a pileup near the front of the peloton with just over 5K left that sent several riders to the tarmac. Last year’s runner-up Rigoberto Uran (EF Education First-Drapac) and Katusha leader Ilnur Zakarin were slowed down by the accident.
Van Avermaet, the 2016 Olympic road race champion who is a support rider for BMC leader Richie Porte, took the overall lead when his team won Monday’s team time trial.
There were no changes among the other title hopefuls.
Tom Dumoulin was seventh (11 seconds behind), Uran was 10th (:35), and Porte 14th (:51). Movistar teammates Alejandro Valverde and Mikel Landa were 15th and 16th (:53), narrowly ahead of Froome. The 2014 champion Vincenzo Nibali was 19th (1:06), Romain Bardet 20th (1:15), and Nairo Quintana was 48th (2:08).
A four-man breakaway of Dimitri Claeys and Anthony Perez (Cofidis), Guillaume Van Keirsbulck (Wanty), and Jerome Cousin (Direct Energie) opened up a gap of more than seven minutes early on, but they were slowly reeled in and swallowed up by the Quick-Step-led pack with 2 kilometers to go.
Fans cheered and waved the black-and-white striped Breton flag on the roadside as the peloton rolled through the country villages.
The Tour will spend three more days in northeastern Brittany. Next up is Stage 5, a hilly 204.5-kilometer leg from Lorient to Quimper.
‘‘Tomorrow is going to be a hard stage. It is a mini-classic in the Tour,’’ said Van Avermaet, who excels at the single-day classics.
‘‘It depends on who wants to defend and who wants to go for it. I think it is the first big stage of the race. [Depending] on how it goes there will be differences between the riders.’’
Cycling’s most prestigious race will then work its way east before hitting the feared cobblestones of Stage 9 and then heading south and into the mountains.
Froome, who was cleared of doping allegations last week by the International Cycling Union, has been jeered by some skeptical fans since arriving in France. During Tuesday’s stage, several syringes were seen alongside the course route in apparent protest by anti-Froome spectators.
Froome is trying to join the select group of Jacques Anquetil, Eddy Merckx, Bernard Hinault, and Miguel Indurain as the only riders to win the Tour five times.