Fernando Alonso had doubts about continuing in Formula 1 following his appearance in the Indianapolis 500 in May before ultimately deciding to remain in the series with McLaren.

Alonso and McLaren announced on Thursday they had agreed a new, multi-year contract that would see their partnership extend into a fourth season in 2018.

The announcement put an end to months of speculation about Alonso's future, with the Spaniard repeatedly stressing he needed to be in a position to win races and compete at the front of the grid in 2018, leading him to consider options in series besides F1.

"I looked at other options in the August break. After Indianapolis, when I came back to F1, I had doubts if I could continue in Formula 1 and if I should look at other series," Alonso said.

"In the August break I had a few conversations with other teams just to know their projects, their situations and some of them are winning teams this year, so there were some conversations there.

"As I said on the press release, something inside told me to stay at McLaren. I think this year we have proved the chassis is capable of fighting at the front, we saw a lot of progress and I think the organisation is much more logical in terms of winning in the short-term in Formula 1."

Alonso had settled on staying at McLaren towards the end of the European season, but wanted the team to finalise its engine plans before putting pen to paper on a new deal.

"After the summer break, maybe around Spa or Monza, I was ready to make an extension of the contract but at that time the team was not ready," Alonso explained.

"They were in a changing situation with the power unit and then they decided to change to Renault. I made sure with the Renault people, because I have a very strong relationship [with them] for many years now, what the situation was with the power unit, making sure that there was nothing crazy going on.

"They were not very serious [talks with other teams], but there were some."