Joaquim Rodriguez, the leader of the Giro d'Italia, passed his first major mountain test with flying colours as he won the 17th stage, his second stage win of the race, yesterday.

Ivan Basso, twice a Giro winner, finished second behind the Spanish Katusha rider in the six-rider sprint which decided the mammoth mountain stage from Falzes to Cortina d'Ampezzo, with Canada's Ryder Hesjedal, the former race leader, in third. There was no time change among the top three in the overall standings, so Rodriguez still leads Hesjedal by 30 seconds and Basso by 82.

Rodriguez said his win was in memory of fellow Catalan bike rider Xavier Tondo, who died a year ago in a freak domestic accident. "It was very important for me to win today," Rodriguez, who broke down in tears. "Xavi was a very good friend who I'd raced with for a long time as kids, not just as a pro."

Despite the stage win, Rodriguez acknowledged he would have to do more to increase his overall lead since Hesjedal is expected to make up a lot of time in Sunday's final time trial in Milan.

"If things stay as they are in terms of time, clearly it'll be impossible for me to win the Giro, but also impossible for Basso and for 2011 Giro winner Michele Scarponi," said the Spaniard. "I need two minutes on him [Hesjedal] before Sunday. Logically, I'm going to have to attack in the mountain stages. Hesjedal's the big favourite to win overall now."

Basso and his Liquigas team upped the pace on the relentlessly steep final 9.9km climb of the Passo Giau, shredding the lead group to six by the summit and with the Czech Roman Kreuziger, fifth overall before the stage, one of the biggest names to crack.

Following a fast, technical descent to Cortina d'Ampezzo, Basso tried a last-kilometre attack, but Rodriguez swept past to claim his second stage win of the race, following his uphill win in Assisi on stage 10. "We've shaken up the overall classification a bit but things have not worked out quite as well as I'd have liked. Hesjedal, in particular, impressed me," said Basso.

Team Sky's Mark Cavendish, the Great Britain Olympian from Isle of Man, still leads the points standings and will wear the red jersey for today's 149km stage from San Vito di Cadore to Vedelago.

His lead has been whittled down to a single point over Rodriguez, though, after he suffered on the tough 186km stage. He struggled on the stiff climbs and reached the finish more than 38 minutes behind the leading group.

Cavendish's Team Sky colleague, the Colombian rider Rigoberto Uran, was fourth and retains the white jersey as the best young rider.