Renault's Fernando Alonso will replace Kimi Raikkonen at Ferrari next season.
Spain's Alonso, world champion in 2005 and 2006, has signed a three-year deal and will partner Felipe Massa next year.
"We are very pleased to welcome to our team a winning driver, who has demonstrated his extraordinary worth by already claiming two world titles in his career," Ferrari team boss Stefano Domenicali stated.
"Fernando has an exceptional personality and we will do everything to give him and Felipe a competitive car. We are certain these two drivers will form the best possible double-act for a team like ours.
"Having said that, we want to thank Kimi for what he has done with Ferrari."
"We have jointly decided to end my deal with Ferrari a year early," Raikkonen said ahead of Sunday's Japanese Grand Prix.
"I am really sorry to leave a team with whom I have spent three fantastic years full of victories.
"I managed to become 2007 world champion, an objective I had since the start of my career. I will always carry great memories with me."
Raikkonen won the 2007 title by a point before finishing a disappointing third last year.
He lies fifth this season after a poor year for defending champions Ferrari, who are clinging on to third in the constructors' standings with three races left.
Brazilian Massa has been out of action since fracturing his skull at July's Hungarian Grand Prix but has already started karting and is expected to be fit for the start of next season, if not before.
Italy's Giancarlo Fisichella, filling in for Massa this season, will be Ferrari's reserve driver next year.
Alonso, 28, has been linked with Ferrari for years and speculation of an announcement increased at last month's Italian GP when Ferrari unveiled a sponsorship deal with Spanish bank Santander.
Ferrari said he would become their second Spanish driver after Alfonso De Portago raced for the team in 1956 and 1957.
Current Ferrari test driver Marc Gene is also Spanish.
Alonso left Renault after his two world titles to join McLaren in 2007 but he accused them of favouring then rookie driver Lewis Hamilton, who won last year's title.
He returned to Renault after just one season away but the car has not been competitive for the past two years and he is now eighth in the driver standings, led by Brawn's Jenson Button.
A race-fixing scandal at last year's Singapore Grand Prix recently led to Renault receiving a suspended permanent ban while team manager Flavio Briatore was banned for life for his role in Nelson Piquet Jr's deliberate crash.
Alonso, who won that race, was cleared of any involvement.
Briatore, who brought Alonso into the sport, also acted as his manager but is now not allowed to have any dealings inside F1.