FLORENCE, Italy -- Rui Costa of Portugal prevailed over a star-studded field to win a grueling road race at the cycling world championships Sunday, edging Joaquin Rodriguez of Spain in a two-man sprint finish.

Rodriguez attacked several times in the final lap of a hilly circuit but Rui Costa caught him in the finishing straight and easily won the sprint for the biggest victory of his career.

In the final kilometre, Rodriguez turned around and said something to Rui Costa.

"He told me to pass him," Rui Costa said after putting on the rainbow jersey. "Obviously I didn't want to pass him. Then it was just a tactical game. I was just hoping my legs wouldn't fail me and they didn't."

Rui Costa clocked 7 hours, 25 minutes, 44 seconds over the marathon-like 272-kilometre (169-mile) route to become the first Portuguese winner in the race's 86-year history.

The 26-year-old Rui Costa has won three stages at the Tour de France, one in 2011 and two this year, and he also won the Tour de Suisse this year and last.

Rodriguez crossed with the same time and Alejandro Valverde of Spain edged local favourite Vincenzo Nibali of Italy for third, 15 seconds behind.

"The only thing that counts is to win and I didn't win today," Rodriguez said. "Rui Costa had had the race of his life."

Rui Costa, whose full name is Rui Alberto Faria Da Costa, has been a teammate of Valverde's on the Movistar trade team but he will join Lampre next year.

It was Valverde's record fifth podium but he has still never won.

"I'm not happy with third now but I think later I will be, and also with Purito's (Rodriguez's) silver. It was a good day for Spain," Valverde said. "Although I would be happier with gold."

The course started in Lucca near the coast and ended with 10 laps of a difficult 16.6-kilometre (10.3-mile) circuit in and around Florence.

For more than six hours, heavy rain fell. But the sun eventually came out and dried the course for the final lap.

Still, the conditions resulted in only 61 of 208 riders finishing.

The circuit's highlights were one long climb, a 4.4-kilometre (2.7-mile) ascent to the scenic town of Fiesole with an average gradient of 5 per cent, then after a brief but technical descent another short but steep climb of 600 metres (yards) with gradients as high as 16 per cent.

With the constant climbing and descending, some riders compared it to a roller-coaster...

Despite the rain, fans turned out in large numbers, especially when riders passed by Florence's Duomo cathedral and wound their way through the city's medieval streets.

Five riders broke away from the pack soon after the start and established a lead of 7 minutes at one point. But the main pack began to pick up the pace as it entered the circuit and of the original five -- Bartosz Huzarski (Poland), Rafaa Chtioui (Tunisia), Yonder Godoy (Venezuela), Matthias Brandle (Austria) and Jan Barta (Czech Republic) -- only Barta and Huzarski were left in front after five laps.

Huzarski was the lone leader when Italy's Giovanni Visconti caught up with him during the eighth lap but they were both then quickly swallowed by the chasing pack.

A group of about 50 riders was in the lead entering the final lap. Then the attacks began, first by Italy's Michele Scarponi on the Fiesole climb, then by Nibali, and finally with Rodriguez and Rui Costa.

Pre-race favourites Peter Sagan and Fabian Cancellara couldn't respond to Scarponi's attack and were dropped. Sagan finished sixth and Cancellara was 10th, each 34 seconds behind.

With riders not permitted to wear two-way radios, they were advised of their status by team helpers along the side of the road holding up info boards, like in Formula One.

There were several crashes. One, on the second lap of the circuit, forced 2009 winner Cadel Evans of Australia to withdraw. Also, Rigoberto Uran of Colombia crashed hard on the final lap.

It was a race to forget for what was considered a strong British team featuring the last two Tour de France winners, Bradley Wiggins and Chris Froome, plus sprinting standout Mark Cavendish.

Of the eight British starters, none finished.

"Bad day for me today," Froome tweeted. "Really tough circuit under these conditions."

Also, it was announced that Jonathan Tiernan-Locke, who withdrew from the British team earlier this week, was notified by the UCI of a potential discrepancy in his biological passport data.

The American squad also had big aspirations, with recent Spanish Vuelta winner Chris Horner and Tejay van Garderen leading the way, but Alex Howes in 31st and Peter Stetina in 37th, both 2:01 behind, were the only U.S. finishers.

Next year's worlds will be held in Ponferrada, Spain.