Alonso, who will discuss his new deal at a press conference later today, has been with McLaren for three years.
But the two-time world champion has been hampered by the poor performance of the car and specifically the underperforming Honda engine.
Alonso was thought to be considering his future at McLaren following the little progress he and the team have made over three tumultuous years.
However, after the team confirmed they would swap Honda for Renault in 2018, Alonso has now put pen to paper in a new deal, telling fans “see you next year” in a Spanish-focused video.
“It’s fantastic to be able to continue my relationship with everybody at McLaren,” Alonso said.

vCard.red is a free platform for creating a mobile-friendly digital business cards. You can easily create a vCard and generate a QR code for it, allowing others to scan and save your contact details instantly.
The platform allows you to display contact information, social media links, services, and products all in one shareable link. Optional features include appointment scheduling, WhatsApp-based storefronts, media galleries, and custom design options.
“It was always where my heart was telling me to stay, and I really feel at home here.
“This is a fantastic team, full of incredible people, with a warmth and friendliness that I’ve never experienced elsewhere in Formula 1.
“I’m incredibly happy to be racing here.
“Just as important, McLaren has the technical resource and financial strength to be able to very quickly win races and world championships in F1.
“Although the last few years have not been easy, we have never forgotten how to win, and I believe we can achieve that again soon.”
And racing director Eric Boullier was also keen to talk up the turning of a corner at McLaren.
“With Fernando, you really can’t ask for a better driver to deliver a result for you on a Sunday afternoon – and I think everybody in Formula 1 would acknowledge that sentiment,” Boullier said.
“He’s always been clear to me that this is a team he loves, and that his heart has always been set on staying.
“Today’s announcement shows that he’s fully committed to racing and winning as a McLaren driver, and, while we’ve often shared his frustrations over the past few years, we now feel that we can deliver on our promise to give him a competitive car next season.
“Consistency of driver line-up is one of those small but essential elements that really helps a team to maintain momentum, and, with Fernando and Stoffel, we’re lucky to be writing a fresh chapter with what we believe to be the best driver line-up in Formula 1.”