Two-time world champion Fernando Alonso announced on Tuesday that he will retire from Formula One at the end of the season after his recent struggles with underachieving McLaren.

The 37-year-old Spaniard – who has 32 Grand Prix wins to his credit in 17 seasons – has become increasingly disenchanted with Formula One as the once all-powerful McLaren team have fallen way off the pace.

Alonso – who in 2005 became the youngest ever Formula One world champion while driving for Renault before defending his title the following year – has garnered 44 points this season and is ninth in the drivers’ championship.

Alonso went on to drive for McLaren for a year in 2007 followed by a return to Renault and then four years at Ferrari, before beginning his second spell with McLaren in 2015.

“I have seen you (Formula One) changing, sometimes for good, others, in my opinion, for bad,” said Alonso, who on three occasions finished runner-up in the drivers’ championship while at Ferrari.

“And this year, while still driving at my best, is how I want to remember you.”

Alonso, whose best finish for McLaren so far was 10th in 2016, said he would carry on endeavouring to finish with a flourish.

He left the door slightly ajar, saying in a statement posted on the McLaren website he could return when it is “the right moment for me to be back in the series”, but the personal message on his Twitter account sounded like a farewell.

- ‘Exploring new adventures’ -

Alonso, whose first win came in the 2003 Hungarian Grand Prix but who hasn’t won since the Spanish Grand Prix five years ago, says new challenges await.

The former Ferrari star is known to be keen to complete the ‘Triple Crown’ of world Formula One champion, winning the 24 Hour Le Mans race and the Indy500 – he has achieved the first two of those aims.

McLaren – whose unpopular racing director Eric Boullier resigned in early July – issued a statement bordering on a eulogy to the Spaniard.

“Fernando is not only an outstanding ambassador for McLaren but also for Formula 1,” said Zak Brown, McLaren Racing’s CEO in a statement. His 17 years in the sport, as arguably the pre-eminent driver of his generation and undoubtedly an F1 great, have added another layer to Formula 1’s rich history.

“There is a time for everyone to make a change and Fernando has decided the end of this season to be his.

“We respect his decision, even if we believe he is in the finest form of his career.”

Alonso confirmed the decision with a video on social media, with the caption ‘Dear F1...’.

In a statement published by McLaren, Alonso said:

“After 17 wonderful years in this amazing sport, it’s time for me to make a change and move on. I have enjoyed every single minute of those incredible seasons and I cannot thank enough the people who have contributed to make them all so special.

“There are still several grands prix to go this season, and I will take part in them with more commitment and passion than ever.

“Let’s see what the future brings; new exciting challenges are around the corner. I’m having one of the happiest times ever in my life but I need to go on exploring new adventures.

“I want to thank everyone at McLaren. My heart is with the team forever. I know they will come back stronger and better in the future and it could be the right moment for me to be back in the series; that would make me really happy. I have built so many great relationships with many fantastic people at McLaren, and they have given me the opportunity to broaden my horizons and race in other categories. I feel I am a more complete driver now than ever.

“I made this decision some months ago and it was a firm one. Nevertheless, I would like to sincerely thank Chase Carey and Liberty Media for the efforts made to change my mind and everyone who has contacted me during this time.

“Finally, I would also like to thank my former teams, team-mates, competitors, colleagues, partners, journalists and everyone I have worked with in my F1 career. And, especially, my fans all over the world. I am quite sure our paths will cross again in the future.”