Spain's Gorka Izagirre took second place and Yates finished third, 15 seconds behind.
Frenchman Alaphilippe retains lead.
World champion Peter Sagan claimed his third 2016 Tour de France stage victory when he pipped Alexander Kristoff on the line at the end of the 16th stage, a 209-km ride from Moirans-en-Montagne on Monday.
The World No 1 sustained the pace in the climbs up to the Col de Vars and the Col d'Izoard, both culminating at more than 2,000 metres, but then lost ground when his compatriot Thibaut Pinot accelerated to rein in defending champion Geraint Thomas.
'It's a big emotion because I've won on the Tour. I haven't won (a race) since the start of the season. It's great to make it. It was tough but I'm super happy to have won.'
Briton Adam Yates retained the overall leader's yellow jersey after staying tucked in the main peloton, which crossed the line with a deficit of 2:53.
The 22-year-old Bernal, the youngest rider to win the race in 110 years, gave Team Ineos --formerly Team Sky -- their seventh title in the last eight editions.
Geraint Thomas was in prime position to win his maiden Tour de France after he retained the overall leader's yellow jersey in a lively 19th stage won by Slovenian Primoz Roglic as defending champion Chris Froome slipped down to fourth on Friday.
Froome had been the favourite to retain his title but he paid the price for the efforts he made to win the Giro d'Italia in May as he just failed to become the first man in 20 years to achieve the Giro-Tour double.
Geraint Thomas tightened Team Sky's grip on the Tour de France when he handed the British outfit their sixth title in seven years on Sunday and there is no sign that their domination will end anytime soon.