Irish cyclist Daniel Martin won the 17th stage of the Giro d’Italia on Wednesday to complete a set of Grand Tour victories, while Egan Bernal had three seconds shaved off his overall lead and saw one of his main rivals gain significant time after a disappointing day in the high mountains.

Martin, who rides for Israel Start-Up Nation, attacked from a breakaway at the start of a tough climb to the summit finish and rode solo to victory to add to his two stage wins in both the Tour de France and the Spanish Vuelta.

More Images
Colombia's Egan Bernal reacts after completing the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Marco AlpozziLaPresse via AP)

Irish cyclist Daniel Martin won the 17th stage of the Giro d’Italia on Wednesday to complete a set of Grand Tour victories, while Egan Bernal had three seconds shaved off his overall lead and saw one of his main rivals gain significant time after a disappointing day in the high mountains.

Britain's Simon Yates completes the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Marco AlpozziLaPresse via AP)

Simon Yates crossed the line in third, 30 seconds behind Martin, to move up from fifth into third place overall, 3 minutes, 23 seconds behind Bernal.

Ireland's Daniel Martin celebrates after winning the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Massimo PaoloneLaPresse via AP)

The Giro finishes on Sunday in Milan with an individual time trial.

Ireland's Daniel Martin pedals on his way to win the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio FerrariLaPresse via AP)

Ireland's Daniel Martin pedals on his way to win the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio FerrariLaPresse via AP)

Colombia's Egan Bernal, wearing the pink jersey of the overall leader, pedals in the pack during the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio Ferrari LaPresse via AP)

Colombia's Egan Bernal, wearing the pink jersey of the overall leader, pedals in the pack during the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio Ferrari LaPresse via AP)

Cyclists pedal during during the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio Ferrari LaPresse via AP)

Cyclists pedal during during the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio Ferrari LaPresse via AP)

Cyclists pedal during during the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio Ferrari LaPresse via AP)

Cyclists pedal during during the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio Ferrari LaPresse via AP)

João Almeida was second, 13 seconds behind Martin at the end of the 193-kilometer (120-mile) route from Canazei to Sega di Ala that also featured two other categorized climbs.

Colombia's Egan Bernal reacts after completing the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Marco AlpozziLaPresse via AP)

Colombia's Egan Bernal reacts after completing the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Marco AlpozziLaPresse via AP)

Simon Yates crossed the line in third, 30 seconds behind Martin, to move up from fifth into third place overall, 3 minutes, 23 seconds behind Bernal.

Bernal, who rides for Ineos Grenadiers, was dropped from the group of his main rivals shortly before the end of the climb and crossed in seventh.

The 2019 Tour champion saw his lead cut slightly to 2:21 ahead of Damiano Caruso.

Britain's Simon Yates completes the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Marco AlpozziLaPresse via AP)

Britain's Simon Yates completes the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Marco AlpozziLaPresse via AP)

The Giro finishes on Sunday in Milan with an individual time trial.

More AP sports: https://apnews.com/apf-sports and https://twitter.com/AP_Sports

Ireland's Daniel Martin celebrates after winning the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Massimo PaoloneLaPresse via AP)

Ireland's Daniel Martin celebrates after winning the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Massimo PaoloneLaPresse via AP)

Ireland's Daniel Martin pedals on his way to win the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio FerrariLaPresse via AP)

Ireland's Daniel Martin pedals on his way to win the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio FerrariLaPresse via AP)

Colombia's Egan Bernal, wearing the pink jersey of the overall leader, pedals in the pack during the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio Ferrari LaPresse via AP)

Colombia's Egan Bernal, wearing the pink jersey of the overall leader, pedals in the pack during the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio Ferrari LaPresse via AP)

Cyclists pedal during during the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio Ferrari LaPresse via AP)

Cyclists pedal during during the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio Ferrari LaPresse via AP)

Cyclists pedal during during the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio Ferrari LaPresse via AP)

Cyclists pedal during during the 17th stage of the Giro d'Italia cycling race, from Canazei to Sega Di Ala, Italy, Wednesday, May 26, 2021. (Fabio Ferrari LaPresse via AP)