Alberto Dainese bounced back from stomach problems to win stage 17 of the Giro d'Italia in a photo finish as Geraint Thomas finished safely to retain the leader's pink jersey.
Dainese, who has spent several days suffering with illness, edged out the fast approaching Jonathan Milan by a tyre's width in Caorle with Michael Matthews a couple of inches further back.
Mark Cavendish, still seeking a first win of the season a couple of days after announcing it would be his last as a professional, had been near the front of the bunch on the approach to town.