The ban, which will come into effect in 2022, will target advertisements on television, radio, online outlets and mobile apps peddling content for under 16s, Spanish Consumer Affairs Minister Alberto Garzón told reporters.
“Minors are vulnerable consumers and it is our duty to protect them from advertising,” he said.
The ban will apply to adverts for chocolate bars, pastries, ice cream, soft drinks and other sugary beverages — products the World Health Organisation has said are “harmful” for children.
The minister said Spain would follow in the footsteps of other European nations such as Britain, Norway and Portugal.
Around one in three children in Spain have excess bodyweight, up from just three percent in 1984, according to Spanish government figures.
“Advertising is one of the causes of this figure”, the consumer affairs ministry said in a tweet.
The prevalence of obesity or being overweight among children and adolescents aged five to 19 worldwide has risen dramatically from 4.0 percent in 1975 to just over 18 percent, according to the WHO.