The company, which unveils its first worldwide brand campaign, "I'm lovin' it", in Munich tonight (Wednesday), is to sponsor Timberlake's 35-city European tour, which begins in Germany in November.
In return, the singer will undertake work to support McDonald's charities, its World Children's Day on November 20 and its global sports sponsorships including the World Cup in 2006 and next year's Olympic Games.
McDonald's declined to comment on the exact length or cost of the tie-up, but described it as "long term".
The deal with former boy-band star Timberlake, whose solo career has taken off dramatically in the past year, is one of the most significant marketing innovations in McDonald's history. It is being launched as the firm fights back against declining sales and accusations that it has contributed to an increase in obesity.
"I'm lovin it" will hit the UK on September 17, backed by an estimated £7m spend through Starcom Motive. It includes promotional and PR activity. It was created by Munich ad agency Heye & Partner and includes three brand versions, aimed at adults, families and general consumers. One TV spot focuses on McDonald's "World Famous Fries", another on Ronald McDonald.
"Timberlake is perfect for the McDonald's brand and our campaign is about connecting with our customers in fresh, modern, relevant ways," said Larry Light, McDonald's executive vice-president and global chief marketing officer.
Timberlake will be given cameo roles in the ads and has recorded the campaign's vocals as his latest single.
The campaign forms part of McDonald's 'Rolling Energy' project, the company's first integrated two-year global marketing programme.