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.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
(Reporting by Martyn Herman; Editing by Tony Jimenez)
