Double world champion Fernando Alonso will stay with McLaren in 2018 after signing a new contract with the British Formula One team.
McLaren did not say whether the new contract extended beyond next year.
The Spaniard has endured a miserable three years with the British-based former world champions and had refused to commit to staying until he felt they could provide him with a competitive car.
McLaren have gone some way towards answering those doubts by ending a troubled partnership with Honda and switching to Renault engines in 2018.
"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," the Spaniard said in a team statement at the U.S. Grand Prix.
"McLaren has the technical resource and financial strength to be able to very quickly win races and world championships in F1," added the 36-year-old, who won his two championships with Renault in 2005 and 2006.
"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."
Alonso has not been on the podium since 2014, when he was with Ferrari. His last win was in Spain in 2013, again with the Italian team.
McLaren are currently ninth overall, out of 10 teams, and the season ranks as the worst of Alonso's career with the exception of his debut year with now-defunct tail-enders Minardi.
He has six retirements in 16 races so far in 2017, and failed to start in Russia while also missing Monaco to compete at the Indianapolis 500 in May. The Spaniard has scored points only twice.
McLaren executive director Zak Brown said continuing with Alonso, as team mate to Belgian Stoffel Vandoorne, had always been the obvious thing to do.
"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 weG��ll be able to take a meaningful step forward," he said.
"Fernando fully understands and buys in to the direction we are taking.
"Our shareholders have ambitious plans for the whole Group, and success within Formula One is a central pillar of that strategy. With Fernando, there is no doubt that we have a driver who can help us achieve our goal of winning again in F1."