AUSTIN, Texas (AP) — Formula One driver Fernando Alonso has put an end to the uncertainty by extending his contract with McLaren to the 2018 season.

The two-time F1 champion's current three-year contract ends this year and the 36-year-old Alonso was considering his options with other teams, and even whether to continue in F1.

Alonso, who won the title in 2005 and 2006 with Renault, said "it's fantastic to be able to continue my relationship with everybody at McLaren" and that "my heart was telling me to stay."

The Spaniard's decision to stay for an additional year comes on the back of McLaren's recent decision to ditch Honda engines next year and switch to Renault.

Honda's F1 return in 2015 was greeted with huge enthusiasm amid hopes of rekindling what was once a hugely successful partnership in the glory era of Alain Prost and Ayrton Senna.

But despite signing up Alonso and pairing him with 2009 F1 champion Jenson Button, it failed spectacularly.

Alonso grew increasingly frustrated — including comments on social media — with the team's underperforming car. Alonso has only 10 points this season and is 16th.

"It has been three difficult seasons for us," Alonso said. "Now I think it's time to change this situation and hopefully next year to be back in the positions that McLaren belongs ... Let's see what we can do next year, but definitely happy again to have a Renault engine on my car."

Speculation had grown that Alonso might leave F1 altogether when he skipped this season's Monaco GP to compete in a one-off race in the Indianapolis 500.

Alonso wouldn't detail his contract extension other than to say it is for more than one year. He said he won't race Indianapolis in 2018, but said he could be back there in the future and hinted he may drive other series as well.

"I don't know if it will be 2019 or 2020 or whenever but it's a race that I definitely will experience again," Alonso said. "There are no other priorities than Formula One at the moment, but with a door open for different series and different goals. I always believed that you need to win in other series if you want to be a more complete driver, a better driver, because motorsport it not only Formula One." Alonso has done well to get the most out of an ailing car and still has the competitive streak that saw him win 32 races — even though the last of those was in 2013 with Ferrari.

McLaren racing director Eric Boullier said "you really can't ask for a better driver to deliver a result ... I think everybody in Formula One would acknowledge that."

Alonso will race alongside Belgian driver Stoffel Vandoorne next year, keeping the current partnership in place.

___

AP Sports Writer Jerome Pugmire contributed to this report.

___

More AP Auto Racing: http://racing.ap.org/