Adverts for McDonalds and Burger King have been banned after they were placed less than 100 metres (328ft) from the gates of primary schools.
The McDonalds poster for the Cadbury Flake McFlurry was seen in July at a bus stop, just 47 metres (154ft) from the gates of a primary school.
A poster for Burger Kings Whopper Jr £2.99 meal deal, also seen in July, featured an image of the burger, fries and a zero sugar Coca-Cola at a bus stop 96 metres (315ft) from a school.
McDonalds said it had instructed outdoor advertising company JCDecaux to comply with its policy of not placing any ads for products high in fat, sugar or salt (HFSS) within 200 metres (656ft) of a school.
It said JCDecaux was solely responsible for the oversight but accepted it was ultimately responsible for any misplacement of the ad.
JCDecaux said the Burger King ad had been incorrectly placed due to a data conflict in its booking system.
Banning both ads for being inappropriately targeted at children, the Advertising Standards Authority (ASA) told the companies to ensure that they took measures in future to ensure that HFSS product ads were not directed at children under 16, including that they were not displayed in close proximity to a primary or secondary school.
Two more ads for HFSS products – a second McDonalds poster for its Belgian Chocolate Honeycomb Iced Frappe and a poster for Subways Mega Melt sandwich – were not banned because they were placed within 100 metres of a nursery and childrens centre rather than schools.
The ASA said nurseries and centres were generally attended by a smaller number of children than schools, which meant the audiences for the ads were unlikely to be significantly skewed towards under-16s.
In a separate ruling, the watchdog reversed its earlier decision banning a television ad for Kelloggs Coco Pops Granola that appeared in January between episodes of the Mr Bean cartoon, during programming specially dedicated to children.
The ASA had initially ruled that although it agreed with Kelloggs argument that the granola was not an HFSS product, the branding was synonymous with the original Coco Pops and therefore had the effect of promoting a high-sugar cereal.
However in its updated ruling released on Wednesday the ASA said it would be clear to adults and children that the advert was for Coco Pops Granola and concluded that it was therefore not subject to the restrictions prohibiting HFSS product ads from being shown around childrens programming.
Caroline Cerny from the Obesity Health Alliance, which lodged the original Kelloggs complaint, said: These adverts are designed specifically to appeal to children with fun cartoon characters including the well-known Coco the Monkey and catchy jingles.
The original ruling recognised the power of brand advertising and closed a loophole preventing food companies from advertising to children by using characters and music associated with their unhealthy products.
Following a lobbying effort from Kelloggs, the industry-funded regulator, the Advertising Standard Authority, has rowed back from their original decision.
This is what happens when a large multinational food company uses its legal weight to fight rulings that influence their profits. Sadly the price is the future health of our children.
This is just another example of why we need strong Government action to protect children from unhealthy food marketing, starting with a 9pm watershed on junk food adverts on TV.
A Kelloggs spokeswoman said: We felt the original judgment had potential unintended consequences for the industry and the positive intent of the regulations – acting as a disincentive for food companies like us to develop and launch better for you alternatives at a time when people are looking to our industry to take action.