MADRID (Reuters) - Spanish veteran Alberto Contador will ride for the Trek-Segafredo team next year and is targeting a third Tour de France victory.

The 33-year-old, who has won all three Grand Tours and finished fourth in the Vuelta last week, has spent five years with the Tinkoff outfit that will leave the World Tour at the end of this season.

"I am thrilled about the opportunity that is in front of me. Trek-Segafredo is a very attractive and ambitious project that really inspires me," Contador said in a statement on Thursday.

"I had some excellent conversations with the team management and we have a lot of goals and priorities in common. The big objective is to try and win the most important races on the calendar, first and foremost the Tour de France."

Contador previously triumphed at the Tour in 2007 and 2009.

(Reporting by Martyn Herman; Editing by Tony Jimenez)