Credit: CC0 Public Domain

Spain will ban ads aimed at kids for high-sugar foods and drinks like choclate bars and soda in a bid to slow a growing obesity epidemic, an official said Thursday.

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, Consumer Affairs Minister Alberto Garzon 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 , pastries, , and other sugary beverages—products the World Health Organization 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 of 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.