Mitchelton-Scott rider Yates caught a two-man breakaway of Alaphilippe and Switzerland’s Marc Hirschi on the final climb with 10 kilometres to go in Nice and worked as a team to hold off the peloton.
The trio were almost caught as they played cat and mouse with the finish line beckoning, but Deceuninck-Quick-Step rider Alaphillippe’s final burst saw him pip Hirschi (Sunweb), with Yates crossing one second behind.
Alaphilippe took the yellow jersey from stage one winner Alexander Kristoff and Yates moved up to second, four seconds behind, in the general classification.
Alaphillippe, who sealed his fifth Tour de France stage win in a time of four hours 55 minutes and 27 seconds, was always going to be favourite to win the sprint finish ahead of Yates but Hirschi pushed him all the way.
Belgium’s Greg Van Avermaet (CCC Team) emerged from the chasing peloton to finish fourth ahead of Colombia’s Sergio Andres Higuita (EF Pro Cycling) and Holland’s Bauke Mollema (Trek-Segafredo), who was sixth.
Alaphillippe leads the general classification in a time of 8:41.35, four seconds ahead of Yates, with Hirschi a further three seconds back and Higuita in fourth.
Alaphillippe dedicated his stage win to his late father and could not hide his emotions at the finish.
“There’s big emotion because I’ve won on the Tour,” Alaphillippe said. “I haven’t won since the start of the season, so I’ve been working really hard.
“I’ve been working hard when it’s been really tough due to Covid and I want to dedicate this victory to my father, who died in June.
“I got to the last climb and gave it my all up that climb and having Adam Yates and Hirschi come up as well made me nervous, but we collaborated well into a headwind, which was tough, but I made it.”
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies