The defending Formula 1 champion left to buy a pair of socks before being allowed in.

Former Formula One driver Nico Rosberg almost fell foul of Wimbledon’s strict dress code by forgetting to wear socks.

The German, world champion last season before announcing his retirement, said he would have to go shopping after being told his bare feet and shoe combination meant he would be refused entry to the Royal Box.

But he resolved the faux pas and was later spotted watching the action on Centre Court along with a host of famous faces.

Ticking off Wimbledon from my bucket list today ????✅ pic.twitter.com/j5ZTwjwfG0 — Nico Rosberg (@nico_rosberg) July 14, 2017

The mishap was pointed out to Rosberg during an interview with Wimbledon’s in-house radio station, as he spoke of the “big honour” of sitting in the Royal Box.

Rosberg said: “No way, I made such an effort to be dressed adequately. I cannot believe that. I messed it up.”

He added: “I cannot believe that, so I have to go shopping now, right?”

Excited to see who lifts this on Sunday! ???? #Wimbledon pic.twitter.com/mqplu6zalL — Nico Rosberg (@nico_rosberg) July 14, 2017

It comes two years after his former Mercedes team-mate Lewis Hamilton missed the Wimbledon final, having been refused entry to the Royal Box for failing to adhere to the dress code.

A spokeswoman for the All England Lawn Tennis Club said Rosberg needed socks to enter the Royal Box and had been able to find some.