MONTPELLIER, France — German rider Andre Greipel won Thursday’s sixth stage of the Tour de France in a sprint finish and Daryl Impey became the first South African to wear the race leader’s yellow jersey after taking it from teammate Simon Gerrans.
In baking hot temperatures, Greipel surged ahead some 500 meters from the line and held off a strong challenge from Peter Sagan and Marcel Kittel.
‘‘It was a very nervous stage today,’’ Greipel said. ‘‘We knew we could take it in the sprint and we were ready for that.’’
The 30-year-old Greipel dedicated his fifth career Tour stage win to his Lotto-Belisol teammate Jurgen Van den Broeck, who pulled out before the start after failing to overcome a knee injury from a crash Wednesday.
‘‘Of course, sometimes happiness and sadness can be so close together. I have to say [manager] Marc Sargeant did a great job this morning at the bus and tried to get this out of our heads,’’ Greipel said. ‘‘It shows the character we have in this team.’’
Mark Cavendish was caught in a crash close to the end of the stage and wasted a lot of energy pedaling hard to rejoin the main pack. He finished fourth, the day after winning his 24th career Tour stage to close the gap on archrival Sagan in the contest for the sprinter’s green jersey.
Greipel’s win moved him above Cavendish and into second place, 29 points behind Sagan. Third-place Cavendish is 40 points behind Sagan. Another win for Cavendish would have tied him with Andre Leducq for third on the all-time list of stage winners at the 110-year-old race.
‘‘Today they made it like textbook and we are really happy,’’ Greipel said, praising his teammates.
Perhaps feeling the effects of his spill, Cavendish lacked his usual powers of acceleration and couldn’t generate enough speed when he pulled out to the left and tried unsuccessfully to get around the three in front.
Impey took over the leader’s jersey from his Orica Greenedge teammate.
‘‘It’s a historic day for South Africa, the first to wear a yellow jersey,’’ the 28-year-old Impey said. ‘‘It will definitely change my life. Hopefully people will start recognizing me, maybe.’’
Gerrans revealed he had eased up to let Impey overtake him in the overall standings. That was a reward for Impey helping Gerrans to win Monday’s third stage and his role in helping Orica Greenedge win the team time trial the following day.
‘‘Daryl was a huge part of me getting the jersey so I thought it was a nice gesture to be able to pass it on to him now,’’ Gerrans said. ‘‘He was an integral part of the team’s time trial. I thought it was only fitting that he could spend a day or two in the jersey as well.’’
The pack stayed together until the end of a 110-mile route from Aix-en-Provence to Montpellier that was totally flat, except for one small category 4 climb.
But that did not prevent more crashes in this year’s race.
With about 20 miles left, Cavendish was caught in a tangle at the back of the peloton involving members of the Belkin team. His white Omega Pharma-QuickStep jersey was torn and marked by the fall.
Cavendish, who won in Montpellier two years ago, had shaken off illness and a drop in form to earn his 24th career Tour stage win on Wednesday and close the gap on archrival Sagan.
Cavendish won the green jersey in 2011 but Sagan succeeded him last year, largely because Cavendish was working more to help Sky teammate Bradley Wiggins become the first British rider to win the Tour, rather than defending his own jersey.
Although the Tour route so far has not been particularly tough, there have been several crashes. There was a big pileup on Saturday’s hectic first stage and several riders were hurt in two separate spills Wednesday.
Impey now faces a tougher challenge on Friday’s seventh stage from Montpellier to Albi, which features a 4-mile category 2 climb up Col de la Croix de Mounis. It’s only the start of a demanding few days in the race.