Eddie Dunbar had to settle for third place as Cesare Benedetti took a popular first professional win with victory on stage 12 of the Giro d'Italia and Valerio Conti passed the leader's pink jersey to his team-mate Jan Polanc.
Bora-Hansgrohe's Benedetti and Irishman Dunbar of Team Ineos were among five riders to reach the finish line in Pinerolo together, the last survivors of a 25-man group who had gone up the road almost as soon as they left the start in Cuneo 158 kilometres earlier.
After the group splintered on the imposing climb of the Montoso late in the stage, eight riders regrouped on the descent before one final test in Pinerolo.
Dunbar closed on Gianluca Brambilla (Trek-Segafredo) and Eros Capecchi (Deceunick-Quick-Step) up the steep cobbled climb towards the finish but the three riders then began to look at each other, allowing Benedetti and Bahrain-Merida's Damiano Caruso to sweep by.
Dunbar, making his Grand Tour debut having been thrust into the team at late notice when Egan Bernal broke his collarbone in training, was disappointed with third and blamed a lack of experience.
"I felt like I was one of the strongest here," the 22-year-old told Eurosport. "I knew I wasn't the quickest but certainly one of the strongest. I gambled in the finish.
"With Brambilla and Eros being Italian I knew they'd be a bit more keen than me to get to the finish so I gambled on that and got caught by the guys behind. That's bike racing, you live and learn."
Mitchelton-Scott's Simon Yates sits 13th, still three minutes and 46 seconds behind Roglic, while his fellow Lancastrian Hugh Carthy of EF Education First was one of the riders to lose time.
The 24-year-old slipped to 10th overall, seven minutes and 33 seconds off pink, but will now don the white jersey as the best young rider.