Viviani, the omnium champion at the gained a confidence boosting victory ahead of the Vuelta, which starts on Saturday, as he bounced back from finishing 20th last Sunday in the road race at the European championships in Glasgow.

World road race champion Peter Sagan came 10th, while his Bora teammate Pascal Ackermann, Germany's national champion, crashed two kilometres from the finish and injured his shoulder.

Hamburg police estimate 250,000 spectators lined the course to see the race which also included 18,000 cycling enthusiasts who rode along with the elite field.

The race kicked off a big week for cycling in the country as Tour de France winner Geraint Thomas has star billing for the Tour of Germany, which starts in Koblenz on Thursday.