The 33-year-old Finn won the world title with Ferrari in 2007 but left the Italian team following the arrival of Alonso in 2010.
“I am really happy to be returning to Maranello where I previously spent three fantastic and very successful years,” said Raikkonen.
“I have so many memories of my time at Ferrari, memories which have stayed with me these past years, first and foremost, winning the World Championship title in 2007, which was really unforgettable.
“I can’t wait to be driving a Prancing Horse car again and to reacquaint myself with so many people with whom I had such close links, as well as working with Fernando, whom I consider a great driver, in order to bring the team the success it deserves.”
Ferrari chief Stefano Domenicali added: “I am pleased to welcome Kimi back to the Scuderia, the team with which he won his world championship title.
“I sense he is very happy to be returning to Maranello and very determined to tackle the work that awaits him in the best way possible.”
Speaking before the announcement, Alonso insisted that he would accept any decision the team made about his racing partner.
“We’ve been working very hard and close for four years to give Ferrari the maximum,” said Alonso.
“Whatever decision the team will take will be good for me and we will keep working to give Ferrari the best results possible.”
Raikkonen replaces Felipe Massa at Ferrari after the Brazilian confirmed on Twitter that he would be leaving the team at the end of the 2013 season.
The 32-year-old confirmed the end of his eight-year spell at the Italian outfit on Tuesday night as speculation linking Raikkonen with the seat intensified.
“From 2014 I will no longer be driving for Ferrari,” Massa posted on Twitter. “I would like to thank the team for all the victories and incredible moments experienced together.
“Thank you also to my wife and all of my family, to my fans and all my sponsors. From each one of you I have always received a great support.
“Right now I want to push as hard as possible with Ferrari for the remaining seven races.
“For next year, I want to find a team that can give me a competitive car to win many more races and challenge for the championship, which remains my greatest objective.”
Massa has made 184 starts for Ferrari, winning 11 races, since joining the team in 2006 from Sauber.
Domenicali added: “I wish to thank Felipe with all my heart and also on behalf of all our fans around the world, for the extraordinary job he has done for the team over so many years. Felipe has always behaved like a real team player.”
MORE: The latest football news
MORE: The latest tennis news