It was a rain-soaked and chaotic finish of stage 12, and the Irishman proved strongest, attacking out of the field to catch late breakaway riders Matej Mohoric (Bahrain-Merida) and Carlos Betancur (Movistar), and then surging past them to take the stage victory.
Danny van Poppel (LottoNL-Jumbo) took second place in the sprint, and Niccolo Bonifazio (Bahrain-Merida) was third.
Simon Yates (Mitchelton-Scott) finished safely in the main field and remains in the overall lead by 47 seconds ahead of Tom Dumoulin (Sunweb). Thibaut Pinot (Groupama-FDJ) is 1:04 behind.
Watch how stage 12 of the Giro d'Italia unfolded in the InCycle highlights video above.