Mark Webber stunned Formula One when he said on Thursday he's leaving the series after this season to race Porsche sports cars.

Webber said at the British Grand Prix he's signed a multi-year contract and will compete in Porsche's new LMP1 sports prototype at the Le Mans 24 Hours and in the world endurance championship next year.

He has struggled this season, failing to win a grand prix and is fifth in the drivers' championship, 63 points behind Red Bull teammate Sebastian Vettel. The German is on course for a fourth consecutive title.

Webber first raised doubts about his future with Red Bull after Vettel ignored team orders and overtook him for victory at the Malaysian GP in March. But he insisted on his website that the controversy had nothing to do with his decision, adding that "I've had a personal plan. I've stuck with it. This is the next chapter."

Red Bull confirmed Webber was leaving and said it would make a decision on a replacement later in the season.

Among the favourites would be Lotus driver Kimi Raikkonen, who is a good friend of Vettel's.

"I am sure Mark thought long and hard before making what has no doubt been a very difficult decision," Red Bull principal Christian Horner said. "His achievements in Formula One are extensive and I am sure he will continue to push hard and build on that record until the end of the season.

"We support Mark's decision, he has been an excellent addition to the team since joining us in 2007 and we wish him all the best in the next stages of his career."

Webber said a return to F1 was "highly unlikely" though he acknowledged he did have some opportunities to remain in the series before he settled on Porsche.

"I realize F1 is seen as the absolute pinnacle of motorsport and I've worked with some incredible people, in particular (Red Bull's) Adrian Newey," Webber said on his website. "I've driven in some of the toughest and most challenging conditions and circuits, and against some incredible drivers which I'll continue to do until the end of the year. Will I miss some of this? Yes, of course, but time doesn't stand still for anyone and it's time to move on to my next challenge."

Since joining F1 in 2002, Webber has won nine races and had 36 podium places during a career that also includes stints with Williams and Minardi.

Webber's best season came in 2010 when he just lost a four-way battle for the title that was eventually won by Vettel.

The Australian started strong last season with victories at Monaco and Silverstone but then tailed off and only had two podiums the rest of the way. At 36 and his age increasingly becoming an issue, there was talk that Webber needed a strong start in 2013 to retain his seat and give him any hope of winning a first title.

Porsche hailed Webber as "one of the best and most successful Formula One pilots of our time."

"I learned to appreciate Mark's qualities when we were both involved in Formula One," said Fritz Enzinger, head of LMP1. "He is one of the best pilots I could imagine for our team. I'm absolutely delighted that we have such an experienced and fast regular driver onboard from 2014."

He has raced twice before at Le Mans, including in 1999 when he had a horrific crash in which he went airborne, flipped and ended in a grove of trees.

"I'm very much looking forward to this new challenge after my time in Formula One," Webber said in a statement. "Porsche will undoubtedly set itself very high goals. I can hardly wait to pilot one of the fastest sports cars in the world."