Sergio Perez has confirmed he is to leave McLaren at the end of this season.

Perez, who has been with the UK-based marque for a year, informed his fans via an open letter on his Twitter account that the final two races in the United States this weekend and Brazil next would be his last for the team.

He said: "First of all, I would like to thank McLaren for giving me the opportunity to be with them this season.

"It has been an honour for me to have been in one of the most competitive teams in the sport and I do not regret even a bit having joined them.

"I have always given the best of me for the team and still despite this I could not achieve what I aimed for in this historic team.

"I am committed to deliver very good results in these last two races, especially in Austin (the United States Grand Prix this weekend).

He added: "I would like to wish the team the very best in the future. I will always be a fan of McLaren.

"In the meanwhile, I will be looking at my future to ensure my position in the best possible package to fight for wins.”

It is expected Perez's replacement will be 21-year-old Dane Kevin Magnussen, the current McLaren development driver. He is the son of former F1 driver Jan Magnussen.

McLaren are promoting Magnussen, winner of this year's Formula Renault 3.5 Series, rather than retain Perez, following extensive analysis of performances.

Although McLaren produced one of their worst cars for many years this season, one that is set to complete the campaign without a podium for the first time since 1980, Perez has only scored 35 points to Button's 60.

The 23-year-old has also been out-qualified nine times to eight by the Briton, a slender margin perhaps, albeit with Button renowned in Formula One for not being one of the quickest over a flying lap.

McLaren had hoped Perez would prove a reliable replacement for Lewis Hamilton, quickly moving to sign him last year following the latter's departure to Mercedes.

Perez, however, has failed to show the promise suggested during his time with Sauber last season during which he notably scored three podiums, including runner-up in Malaysia and Italy.

Although Perez was fifth in India at the end of last month, matching McLaren's highest finish this year achieved by Button in China, the team have been underwhelmed by what they have seen.

In particular, time in the simulator of late has shown Magnussen to be quicker than Perez, and that has played a part in their thinking.

It means for the first time since Hamilton in 2007, McLaren are to promote an unproven driver into the big time.