McLaren's F1 team have announced that Fernando Alonso will race for the team in 2018.
Alonso's contract had been due to expire at the end of this season. The Spaniard's Formula One future was up in the air but he has now committed to the Woking-based side for at least another year.
Alonso told McLaren's official website: “It’s fantastic to be able to continue my relationship with everybody at McLaren.
"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."
McLaren's woeful pre-season continued on the final day of the Barcelona test as Fernando Alonso's MCL32 twice ground to a halt at the Circuit de Catalunya.
The former world champion's team and engine suppliers Honda have been plagued by problems which showed no signs of getting any better, with the first race of the season in Australia just over two weeks away.
Alonso's car stopped twice on the track on Friday's morning session to add to the two red flags on Thursday as the team were again robbed of valuable track time ahead of the Melbourne race.
The first stoppage came just over halfway into the morning session, with Alonso's car eventually taking its now customary place on the back of the recovery truck after a short break.
But when Alonso returned to the track with a little over an hour of the session left it stopped again almost straight away.
Mercedes are considering Fernando Alonso as a replacement for retiring world champion Nico Rosberg.
But two-time championship winner Alonso is about to enter the final year of his three-year deal with McLaren, meaning Mercedes may have to look elsewhere.
"You have to consider Fernando," Mercedes boss Toto Wolff told Sky Sports' F1 Special: Nico The Brave show.
"He is a driver I respect a lot. He combines talent, speed and experience. It's all there.
"But he is in a contract with McLaren-Honda at the moment and we just need to weigh all the other options up."
Mercedes face a race against time to bring in a new driver alongside Lewis Hamilton, with pre-season testing due to begin in February.
Rosberg made his surprise announcement last week, just five days after sealing the drivers' championship.
Fernando Alonso has been ruled out of the Bahrain Grand Prix amid concerns he could suffer a punctured lung.
The 34-year-old - who sustained fractured ribs at last weekend's Australian Grand Prix in one of the most spectacular Formula One smashes in recent times - failed a medical test at Bahrain's Sakhir Circuit on Thursday, and his participation at the next race in China in a fortnight's time is also under threat.
Belgian's Stoffel Vandoorne, the untested McLaren reserve driver, has jetted in from Japan to deputise for the two-time world champion.
Fernando Alonso says he is fortunate to be alive after surviving one of the most spectacular crashes in recent Formula One memory.
While Nico Rosberg finished ahead of Lewis Hamilton and Sebastian Vettel to win the opening race of an incident-packed Australian Grand Prix, the season-opener will be remembered for Alonso's terrifying 200mph smash.
After he careered into the back of Esteban Gutierrez under braking for turn three, Alonso was merely a passenger as he slammed into the wall before barrel-rolling through the air twice.
When Alonso's car finally came to a standstill, the Spaniard was upside down, missing all four tyres and much of his McLaren bodywork littered the circuit. Miraculously, the two-time world champion crawled out of his car before limping away from the wreckage.
"I am lucky to be here and thankful to be here," said Alonso. "It was a scary moment and a scary crash.
"When I stopped I saw a little space to get out of the car and I went out quickly just to make sure that my mum, who was watching the race on TV at home, could see that I was okay."
Fernando Alonso has blown apart McLaren's theory a gust of wind was the cause of the pre-season testing accidentRead the full story ›
Fernando Alonso will race in the Malaysian Grand Prix as long as he comes through a final medical assessment on ThursdayRead the full story ›
McLaren confirm that Fernando Alonso will not compete in the Australian GP on advice from doctors due to his recent crashRead the full story ›
McLaren's Fernando Alonso has released a YouTube video reassuring fans that he is well after crashing heavily in testing last weekendRead the full story ›
McLaren expect Fernando Alonso to recover from Sunday's crash in time to race in the season-opening F1 Australian Grand Prix on March 15.
The Spanish driver was released on Wednesday from a hospital in Barcelona having spent three days under observation after crashing his McLaren in pre-season testing in the Circuit de Catalunya.
"I can categorically confirm that he has no lesion and that he wasn't electrocuted," McLaren chairman Ron Dennis said on Thursday, as reported in Spanish newspaper El Mundo.
"There's no sign that Alonso's brain is damaged.
"Alonso is physically well and I see no reason why Fernando can't be in Melbourne, but I'm not a doctor.
"Fernando wanted to return to testing but the doctors have told him that if he wanted to be certain, he needed to rest and have medical follow-ups."