Mark Webber has given some insight into his decision to retire from professional racing at the end of the year, saying he consulted F1 legends Sir Jackie Stewart and Niki Lauda before making the announcement.

Webber will retire from racing at the end of the current World Endurance Championship season to become a Porsche representative among other roles. The decision will bring an end to a 26-year racing career, which included nine F1 victories and the 2015 WEC title, and Webber said he asked three-time champions Stewart and Lauda for advice on when to call it quits.

"Of course hanging up my professional racing helmet is a very big decision but I've been extremely fortunate to receive great counsel from two of the legends of our sport, Sir Jackie Stewart and Niki Lauda, about the timings of such a decision," he said. "The timing is right for me -- you certainly view things a bit differently when you get a bit older and your priorities in life change. As with my F1 career, it's nice to making the decision on my own terms."

Webber will remain with Porsche in an ambassadorial role as well as continuing his work with Red Bull and British F1 broadcaster Channel 4.

"I've really, really enjoyed my time in the cockpit with Porsche and could never have envisaged having such a dynamic relationship with my two team-mates in the #1 919, Timo Bernhard and Brendon Hartley. It's been a sensational three years and off the back of three consecutive wins, I'm hoping we can continue our good form and finish this year strongly.

"It's an absolute honour for me to remain with Porsche and whether it's at the track or away from it, I'm looking forward to putting my 26 years' experience as a competitor to good use in my new role within the company.

"In addition to Porsche, I'm incredibly fortunate to be walking into some new and exciting opportunities with Red Bull (who I will have been with for 10 years next year), Channel 4 in the UK, and Network Ten and Michelin in Australia. As for Aussie Grit himself, I'm working on a couple of new ventures too, so watch this space!"