Philippe Gilbert (BMC) won his first race since October as he sprinted to victory on Stage 12 of the Giro d'Italia in Vicenza.

The 32-year-old admitted the stage was his last chance to end the first Grand Tour of the season with a win to his name.

Alberto Contador (Tinkoff-Saxo) tightened his hold on the overall lead after an impressive second-place on the stage.

Gilbert said: “It was my last chance to win a stage at this Giro. The team did a great job for me today. The final was very difficult, and with so much water, it was very dangerous. I am very happy to win today.”

Early in the stage, a five-man break went clear: Kenny Elissonde (FDJ), Patrick Gretsch (Ag2r La Mondiale), Enrico Barbin (Bardiani-CSF), Davide Appollonio (Androni-Sidermec), and Nick van der Lijke (LottoNL-Jumbo). However, the peloton were clearly anxious to reel the quintet in as soon as possible, and with 57 kilometres remaining, they did just that.

On the Cat. 4 ascent of the Castelnuovo, Gianfranco Zilioli (Androni-Sidermec) launched a solo attack, before Louis Vervaeke (Lotto-Soudal) followed suit. Although several others attempted to get clear of the pack, Vervaeke was the only man able to stay away, and he eventually built up a reasonable advantage.

However, Vervaeke was unable to sustain the effort and with 30 kilometres remaining, he was swept up by the peloton once again.

The descent from the Crosara climb was treacherous thanks to the heavy rain, and it resulted in a number of crashes. Simon Gerrans (Orica-GreenEdge), touted as a potential stage winner, was one victim, with the Australian's season of bad luck showing no sign of ending.

Franco Pellizotti (Androni-Sidermec) attacked on a stretch of flat road and found himself more than 20 seconds ahead of the bunch. He was followed by Tarel Kangert (Astana) and the duo worked together for some time.

Pellizotti began to fade as the leaders entered the final kilometre, and Kangert opted to drop the Italian and go it alone in effort to pick up a surprise stage win.

But he could not hold off the fast-advancing peloton, led by Gilbert's BMC team. The Belgian shook Paolo Tiralongo (Astana) off his wheel and finally caught Kangert with 250 metres remaining.

From that point, there was only going to be one winner on the steep ascent to the finish. Gilbert thrives on the terrain that made up the closing stages, and he made sure no riders were able to follow his winning move.

“This finale is my speciality,” Gilbert continued. “It may look easy, but it [is] never easy. The last 800m was little Cauberg; I came to see it with Fabio Baldato after Milano-Sanremo, so I knew the course very well. It gave me a lot of confidence.

“My morale was low yesterday because as a team we were not able to chase down that breakaway. Today, everyone lifted their spirits, and did great work. I am glad I could finish it off. The team has stayed by me all season despite a rough start to the season. I never gave up hope to get the win.”

Contador surprised many by taking second place on the day, strengthening his grip on the leader's maglia rosa and adding to the time gap between himself and his closest rivals, the Astana duo Fabio Aru and Mikel Landa.

The Spaniard now has an advantage of 17 seconds over Aru, and 55 seconds over Landa.

The Giro d'Italia continues on Friday with Stage 13, with a flat stage from Montecchio Maggiore to Lido di Jesolo before the GC contenders battle it out in Saturday's time trial.