Rossi, arguably Italy's most famous sports personality thanks to his extraordinary skill and madcap antics, has won his seven top class world championships with Japanese teams.
"We are delighted that Valentino Rossi will be with us from 2011. He is a paragon of excellence in the world of motorcycling," Ducati Motor Holding president Gabriele Del Torchio said in a statement.
The 31-year-old Rossi, a winner of nine motorcycling world titles in all, sparked rumours of a departure from Yamaha by entering the last year of his contract without a new deal.
He also said it was awkward being team mate with current championship leader Jorge Lorenzo given they were both so strong.
A vacancy at Ducati arose after Australia's Casey Stoner said last month he would be leaving for Honda next year.
FERRARI FLIRT
Rossi had flirted with the idea of entering Formula One, undergoing tests with Ferrari and setting stunning times for someone used to two wheels.
Ferrari wanted him to fill in when Felipe Massa was injured last year and were also keen to have him as a third driver this season. However, their proposal for a third car was blocked by F1 bosses and Rossi decided his heart lay in MotoGP.
Rossi has competed in World Rally events and he may yet finish up in rallying when he is finally done with bikes.
Rossi fractured his leg before the Italian Grand Prix in June but made a rapid recovery to risk racing again after just six weeks, marking him out yet again as an extra special talent.
He arrived at the track on crutches but set good times.
The injury has all but ruled him out of another title with Yamaha this year with Spain's Lorenzo poised to take the trophy having won six out of nine races with nine more to come.
Nicknamed "the Doctor", his array of colourful helmets and affable nature have made Rossi a hero for Italians and motorsport fans alike with a 2007 tax scandal failing to dent his image.
Yamaha, whose MotoGP unit is based in Italy, said they made an offer to keep Rossi but the lure of a new challenge and racing in the famous red of Italy's Ducati proved too strong.
"As soon as he rides the Ducati for the first time, we will work together on every single detail that will develop a bike capable of showing his huge talent." said Filippo Preziosi, Ducati Corse General Director.
"Working with Valentino is one of the most exciting things for every engineer and it's good to know we will have this great opportunity next season."
Yamaha are now set turn to 2009 Superbikes world champion Ben Spies for next season with the American stepping up from the Yamaha Tech 3 team.
Pedrosa wins German MotoGP, Rossi 4th
Lorenzo wins US MotoGP, Pedrosa crashes
Japanese cars get more expensive
Tata Tele, Airtel, RCom face Rs 136 cr penalty
Bikes and babes at the 10th Auto Show