Although Alonso was widely expected to stay at the Woking-based team, speculation about his future had been rife for months after another torrid season in the Honda-powered car.

The Spanish driver is 16th in the standings with just eight points scored after Honda failed to deliver a competitive power unit again.

The lack of competitiveness has led to McLaren splitting with Honda and joining forces with Renault for 2018, in a move that was seen as key to the team's hopes of retaining Alonso.

On Thursday, it was finally announced that the two-time champion will remain with the squad he has driven for in the last three years.

No details about the length of his contract were revealed.

"It's fantastic to be able to continue my relationship with everybody at McLaren," said Alonso.

"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.

"The last three years have given us the momentum to plan and build for the future, and I'm looking forward to that journey.

"I'm excited for our future together – and I'm already working hard to make it a success."

Alonso had returned to McLaren for the start of the 2015 season, which marked its reunion with Honda as its engine supplier.

The Spaniard had already driven for the team in 2007, before leaving at the end of that year after a troubled season alongside Lewis Hamilton.

Alonso will partner current teammate Stoffel Vandoorne again in 2018.

“I’m delighted to be able to confirm that Fernando will remain at McLaren," said team boss Zak Brown.

"He has been a fantastic asset to the whole organisation for the past three years, is an incredible individual and is one of the most accomplished and talented racing drivers of the modern era.

“It always made sense for us to continue our journey together.

“His commitment will allow us to further improve the attractiveness and potential of the wider Group, and will ensure we head into 2018 feeling increasingly confident that we’ll be able to take a meaningful step forward. Fernando fully understands and buys in to the direction we are taking."