The 24-year-old, son of former world champion Keke Rosberg of Finland, raced for Williams between 2006 and 2009 but announced he was leaving the British team after the Abu Dhabi Grand Prix earlier this month where he finished ninth.
"I am very pleased that I will be in Mercedes' cockpit for the start of the 2010 Grand Prix season," said Rosberg.
"No other brand in Formula One has such a long and successful tradition. I am very proud that I will race for the new team from the start and look forward to working with Ross Brawn."
The German finished seventh in this season's world drivers' championship and his best result was second in the Singapore Grand Prix of 2008. Since his Formula One debut in Bahrain in 2006, Rosberg has yet to win a Grand Prix race. With a second-place and one third-place finish his best in 70 starts in four years of racing, victories are his goal.
"The fact that we will restart in Formula One with such a talented and pleasant driver is great news for us," said the head of Mercedes, Norbert Haug. "Nico is very ambitious, so are we and I am looking forward to working together with him."
Mercedes's team boss Ross Brawn, who masterminded all of Michael Schumacher's seven world titles, said he is delighted to have Rosberg on board.
"After four years in Formula One, I would count Nico Rosberg as an experienced driver," Brawn told German newspaper Bild.
Brawn said he is not in a rush to complete the team's lineup, following world champion Jenson Button's defection to McLaren, but Nick Heidfeld is a possible signing to take the last remaining cockpit berth.