The letter said: “We believe it is wrong for athletes to encourage the excessive consumption of such items, which are fuelling poor health and obesity.

“David Beckham is a great sportsman, yet he has endorsed Pepsi. What about the impact of Gary Lineker’s association with Walkers crisps? Or the partnership between Mars and the FA?

“Food companies, well aware that such foods have few redeeming qualities, are able to trigger the so-called ‘halo effect’ by associating them with sport.”

The letter’s signatories included cardiologist Dr Aseem Malhotra, Dr Hilary Cass, President of the Royal College of Paediatrics and Child Health and Steve Iredale, President of the National Association of Head Teachers.

They pointed out that several athletes will no doubt be offered advertising deals off the back of their Olympic performances and urged them to carefully consider which products they endorse – and what effect they might have on children’s health.

Pepsico, which owns the Pepsi and Walkers brands, declined to comment.