Adverts for junk food high in sugar, salt and fat are to be banned until 9pm on TV adverts in the UK, the government has announced.

Adverts will be subject to heavier online restrictions and a 9pm television watershed from the end of next year.

However, restrictions will stop short of the total ban which was proposed last year, part of Boris Johnson’s efforts to tackle obesity, as brand-only advertising online and on TV will be allowed to continue.

Fast food and confectionery giants will be banned from advertising products high in fat, sugar and salt (HFSS) online but there will be exemptions for small businesses with 249 employees or fewer.

Companies can continue to promote their products on their own websites and social media platforms under the new measures.

Firms will also be able to advertise on television before the watershed if they do not show banned foods, a ruling that is expected to be opposed by health campaigners.

Online audio will be exempted, meaning that fast food and confectionery will be advertised on radio stations broadcasting over the internet, as well as on podcasts.

The new regulations also allow exemptions for the healthiest foods within each category, such as honey, olive oil, avocados and marmite.

Public health minister Jo Churchill said: “We are committed to improving the health of our children and tackling obesity. The content youngsters see can have an impact on the choices they make and habits they form. With children spending more time online it is vital we act to protect them from unhealthy advertising.

“These measures form another key part of our strategy to get the nation fitter and healthier by giving them the chance to make more informed decisions when it comes to food. We need to take urgent action to level up health inequalities. This action on advertising will help to wipe billions off the national calorie count and give our children a fair chance of a healthy lifestyle.”

The new ruling comes after Boris Johnson declared obesity in the UK has to be tackled.

Figures show obesity affects more tan a quarter of UK adults with the population’s weight rising since the early 1990s.

Statistics from NHS Digital show more than 60% of the adult population are now overweight or obese.

Charmaine Griffiths, chief executive of the British Heart Foundation, said: "These plans are a bold and very positive step forward in protecting children from being inundated with junk food advertising.

"Introducing a 9pm TV watershed for junk food adverts and also further restrictions for online advertising is one important part in building a more healthy environment where the healthy option is the easy option."

The Advertising Association said it was “dismayed” by the ban and the food and drink sector branded the plans “headline-chasing policies”.

Sue Eustace, public affairs director at the Advertising Association, said: “We are dismayed Government is moving ahead with its HFSS ad ban on TV before the 9pm watershed and increased restrictions online.

“This means many food and drink companies won’t be able to advertise new product innovations and reformulations and larger food-on-the-go, pub and restaurant chains may not be able to tell their customers about their menus. Content providers – online publishers and broadcasters – will lose vital advertising revenue to fund jobs in editorial and programme-making.

“We all want to see a healthier, more active population, but the Government’s own analysis shows these measures won’t work. Levelling up society will not be achieved by punishing some of the UK’s most successful industries for minimal effect on obesity levels.”