Raikkonen, 38, has been with Ferrari since 2007, where he won the world championship in his debut season. It remains the team's last title.
However, Ferrari have been developing Leclerc for some time, with the 20-year-old driving for Sauber this year, and it had been widely reported they would bring in the youngster for next season.
Ferrari secure Leclerc for the next five years
Raikkonen's departure allowed them to make that move and bring in Leclerc to drive alongside Sebastian Vettel.
Leclerc has secured 13 points this season, including a best finish of sixth at Baku, Azerbaijan following back-to-back titles in GP3 and Formula 2.
Charles Leclerc (Sauber) - GP of Canada 2018
Image credit: Getty Images
Ferrari's statement on Raikkonen read: "During these years, Kimi’s contribution to the Team, both as a driver and on account of his human qualities, has been fundamental. He played a decisive role in the team’s growth and was, at the same time, always a great team player.
As a World Champion for Scuderia Ferrari, he will always be part of the Team’s history and family. We thank Kimi for all of this and wish him and his family a prosperous future.
It had been previously suggested Raikkonen would retire when he left Ferrari, but he quickly confirmed that he will return to Sauber, where he began his Formula 1 career.
Sauber also confirmed the move and that Raikkonen has signed a two-year contract, which will take him into his 40s.
Frederic Vasseur, CEO of Sauber Motorsport and Team Principal of the Alfa Romeo Sauber F1 Team said: "Signing Kimi Raikkonen as our driver represents an important pillar of our project, and brings us closer to our target of making significant progress as a team in the near future.
"Kimi’s undoubted talent and immense experience in Formula One will not only contribute to the development of our car, but will also accelerate the growth and development of our team as a whole. Together, we will start the 2019 season with a strong foundation, driven by the determination to fight for results that count."
Alonso to test for McLaren F1 team in ambassador role
Ferrari unveil new Formula One car for new era