Bernal’s teammate Russia’s Pavel Sivakov was second at 10 seconds and Astana’s Aleksandr Vlasov third 17sec behind.
Bernal thereby took the overall lead of the four-day race, on a stage typical of those found on the Tour with around 40km of hard climbs.
“This is a test day for all the favourites of the Tour,” France’s Thibaut Pinot said ahead of the stage in which he finished fourth 31 seconds behind the 23-year-old winner.
Four-time Tour winner Chris Froome ended the day over five minutes adrift of Colombian Bernal.
French climber Romain Bardet, who fell heavily on Sunday, was 1min 18sec off the winner.
After negotiating the narrow lanes in the Pyrenean foothills the race went up the 10km of the Col de Peyresourde at an average of 7.5%, then ascended the slightly longer Col de Beyrede at 7.2%.
A scattering of die-hard cyclo-tourists had defied the 24-hour traffic ban on the day’s final climb.
There were camper vans and enthusiastic fans but it was a far cry from the kind of pop up motorhome villages that traditionally straddle summit finishes on the Tour de France.
This year’s Tour’s start date was reschedulued for August 29 due to the coronavirus pandemic.