Ireland’s Eddie Dunbar had to settle for third place as Cesare Benedetti took victory on stage 12 of the Giro d’Italia, as Valerio Conti passed the pink jersey to his UAE-Team Emirates colleague Jan Polanc.

The 22-year-old from County Cork, riding for Team Ineos, was among five riders left from a 25-man breakaway to reach the final climb in Pinerolo together, after the group had splintered on the imposing Montoso ascent.

Bora-Hansgrohe’s Benedetti and Bahrain-Merida’s Damiano Caruso swept past the leading trio of Dunbar, Gianluca Brambilla (Trek-Segafredo) and Eros Capecchi (Quick-Step) on the steep, cobbled run to the line.

Benedetti had been dropped near the summit of Montoso but the 31-year-old recovered spectacularly to claim a popular home victory and his first UCI Tour stage win.

Dunbar is making his grand tour debut in Italy, having been thrust into the team at late notice after Egan Bernal broke his collarbone in training. Despite that, he was disappointed not to take the stage victory in Piedmont.

“I felt like I was one of the strongest here,” Dunbar told Eurosport. “I knew I wasn’t the quickest but certainly one of the strongest. I gambled in the finish.”

Slovenia’s Jan Polanc is the new overall race leader. Photograph: Alessandro Di Meo/EPA

“With Gianluca [Brambilla] and Eros [Capecchi] 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.”

Polanc is the new overall leader, more than four minutes ahead of his fellow Slovenian Primoz Roglic (Jumbo-Visma), with former leader Conti in third. Britain’s Simon Yates (Mitchelton-Scott) sits 13th, still three minutes and 46 seconds behind Roglic.

Quick Guide Stage 12 result and overall standings Show Stage 12 (Cuneo–Pinerolo, 158km) 1 C Benedetti (It) Bora-Hansgrohe 3hr 41min 49sec; 2 D Caruso (It) Bahrain-Merida; 3 E Dunbar (Ire) Team Ineos all same time;

4 G Brambilla (It) Trek-Segafredo +2 5sec; 5 E Capecchi (It) Quick-Step +6; 6 J Polanc (Svn) UAE Team Emirates +25; 7 M Montaguti (It) AG-Sidermec +34; 8 T De Gendt (Bel) Lotto-Soudal +2min 36sec; 9 F Gavazzi (It) AG Sidermec st; 10 M Senni (It) Bardiani-CSF +2:38 General classification 1 J Polanc (Svn) UAE Team Emirates 48hr 49min 40sec; 2 P Roglic (Svn) Team Jumbo-Visma +4min 07sec; 3 V Conti (It) Emirates +4:51;

4 E Capecchi (It) Quick-Step +5:02; 5 V Nibali (It) Bahrain-Merida +5:51; 6 B Mollema (Neth) Trek-Segafredo +6:02; 7 R Majka (Pol)

Bora-Hansgrohe +7:00; 8 R Carapaz (Ecu) Movistar Team +7:23; 9 A Amador (Cos) Movistar Team +7:30; 10 H Carthy (GB) EF Education First +7:33; 11 E Gasparotto (It) Team Dimension Data +7:37; 12 I Zakarin (Rus) Katusha-Alpecin +7:45; 13 S Yates (GB) Mitchelton-Scott +7:53; 14 A Antunes (Por) CCC Team +7:56; 15 F Gavazzi (It) AG-Sidermec +7:59; 16 MÁ López (Col) Astana Pro Team +8:08; 17 T Kangert (Est) EF Education First s/t; 18 M Montaguti (It) AG-Sidermec +8:16; 19 P Sivakov (Rus) Team Ineos +8:18; 20 G Carboni (It)

Bardiani-CSF +8:21.

The 27-year-old Polanc was part of the breakaway which pulled clear almost immediately after the start of the 158km stage in Cuneo. “I was focused to get in the breakaway,” he said afterwards.

“At one point, I was thinking of the stage victory, for sure. But I think I did what I needed to do today. The team didn’t come here with GC ambitions, but we’ve had Valerio in pink and now for me, it’s also really nice.”

EF-Education First’s British rider Hugh Carthy slipped to 10th overall, seven minutes and 33 seconds off Polanc, but will now take over the white jersey as the best young rider.