Sainz reiterated: "I am very happy that I will be driving for Scuderia Ferrari in 2021 and I'm excited about my future with the team".
Sainz replaces Sebastian Vettel, whose departure from Ferrari at the end of this season was confirmed on Tuesday.
He added: "I also want to pay tribute to Carlos for the excellent job he has been doing for McLaren in helping our performance recovery plan".
"When taking these decisions it's because we are convinced we made the right decision, we close the cycle with Sebastian, it's been six years since Sebastian has been working in our team, I admire Sebastian, I admire him as a person and as a professional, I hold him in great esteem".
Ricciardo will quit Renault upon the expiry of his initial two-year deal at the end of the year, having joined the French manufacturer for 2019 following his Red Bull exit.
"Signing Daniel is another step forward in our long-term plan and will bring an exciting new dimension to the team, alongside Lando", said McLaren Racing CEO Zak Brown.
He finished third at the Brazilian Grand Prix for his first podium finish. But we aren't done and I can't wait to get back on the grid this year.
Team principal Mattia Binotto said: "I'm pleased to announce that Carlos will join Scuderia Ferrari as from the 2021 championship".
Carlos Sainz and Daniel Ricciardo
And they needed to secure Ricciardo's signature before that happened.
Confirmation of Sainz's switch is expected later on Thursday.
McLaren had already commenced early talks with Sainz over extending his present contract, which was due to expire at the tip of the yr.
Ferrari could hand Sainz a role similar to Valtteri Bottas' at Mercedes. He will be hoping that McLaren's revival in fortunes continues this year and next.
Speaking to Italian news agency ANSA, he said: "It is correct to support (Charles) Leclerc because he is a very talented, intelligent boy who grew up in our Ferrari Academy".
Both Sainz, 25, and 30-year-old Ricciardo are out of contract at the end of the year.
Alonso said at the end of last year that he would consider a comeback to F1 after two years out, but he will have to weigh up whether he believes Renault will give him the competitive auto he says he wants. "Our ambitions and the strategy of Renault DP World F1 Team remain unchanged".
The announcement that Vettel was leaving had prompted speculation that Lewis Hamilton could be set to finally make the long anticipated move to Ferrari.