SILVERSTONE, England — Mark Webber stunned Formula One on Thursday by announcing that he's retiring at the end of the season to race Porsche sports cars.

Webber said at the British Grand Prix that he has 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.

The Australian 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 Webber 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.

"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."

Horner said he was only called Thursday morning about Webber's decision.

"I suppose an hour's notice is a bit short, but a decision for a driver to retire can only come really from him," he said.

Among the favorites to replace Webber would be Lotus driver Kimi Raikkonen, who is a good friend of Vettel's. The Finn said he would enjoy racing alongside Vettel but said he "still had no answer about" whether he would remain at Lotus or replace Webber in 2014.

Horner said he simply wanted a "fast driver" to replace Webber.

"We want to field the best two cars we can next year," he said. "We are in a fortunate position where there are quite a few drivers who would like to drive a Red Bull car and we have two talented young drivers (Jean-Eric Vergne and Daniel Ricciardo) that we have been developing in Toro Rosso. We don't need to rush into a decision."

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. He said he had no regrets in a career that had its "ups and downs" and would especially miss the camaraderie of fellow drivers and the feeling that comes with driving an F1 car.

"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.

McLaren's Jenson Button and Ferrari's Fernando Alonso, a close friend and rival, welcomed Webber's move to Porsche and praised his long career in F1.

"It's a good time for him, a good opportunity," Alonso said. "He's moving to a very prestigious car brand and probably the most famous race in the world together with Formula One. I think he will have a lot of fun behind the wheel as he is doing now with a little less problems (outside the track) that we have in Formula One."

Vettel, who has clashed several times with his teammate over the years, had nothing but good things to say about Webber. He acknowledged they are not "best friends and probably never will be" but that there could have been "worse couples."

"I have enormous respect for him on the track but I think, off track, a lot of it has been hyped more than it should have because there hasn't really been that much going on," Vettel said. "If you look at other team pairings, I think there's worse couples than us in terms of mutual respect."

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."