Fuglsang finally let go of the elastic on the descent of the final category one climb, first bridging a small gap to the leaders and then making his own headway on a slight uphill with 15 kilometres to go.
The Dane finished 48 seconds ahead of Roglic (LottonNL-Jumbo) who outsprinted Bernal (Sky) for two bonus seconds. Aussie Richie Porte (BMC) finished with the pair but behind Rui Costa (UAE).
The final climb was marked by a flurry of attacks from the favourites including Fuglsang who pulled clear with Costa. But Bernal and Roglic's game of GC cat and mouse swallowed them up and the remnants of an earlier breakaway.
Desperate to wrest the lead from Roglic, the young Colombian launched attack after attack but the Slovenian was left largely unperturbed.
The pair crested the summit with a small gap over Porte, Fuglsang and Costa but it all came back together on the winding descent.
Knowing he was not a threat for GC at that stage, Fuglsang took advantage of a slight rise and quickly built a 40 second lead.
"I already tried to attack at the final climb, but going downhill I had to chase and close the gap with the leaders," Fuglsang said. "But luckily halfway downhill the road went up a little bit and at that point my sports director was screaming at me: “Now is the moment!”, but I responded that I was already racing at my limit."
"But just after that I was in the perfect position, just behind the group that was mostly looking at each other, and so I took my chance."
"I’m really happy with this victory, it gives a really good feeling and a lot of confidence for the start of my preparations for the Tour de France in a few weeks."
Fuglsang's victory saw him leapfrog from 15th to fourth on GC. Roglic leads Bernal by eight seconds overall ahead of Sunday's final 182 kilometre stage in Geneva that favours the fast men.
Third-placed Porte trails Roglic by 35 seconds, compatriot and teammate Rohan Dennis sits seventh.