Spanish toy makers have agreed to end gender stereotypes in their adverts and vowed to stop featuring boys exclusively with cars and soldiers, and girls playing with dolls.

The code of conduct it agreed with Spain's leftist government aims to "avoid biases and gender roles and the sexualised representation of girls," the Consumer Affairs Ministry said in a statement.

It will come into effect on 1 December, just before Christmas, when toys fly off shop shelves.

The protocol will prohibit the "exclusive association" of girls with toys that reproduce roles of "caregiving, domestic work or beauty" and boys with "action, physical activity or technology".

"Toys will not be presented with the express or tacit indication that they are for one gender or another nor will colour associations be made (such as pink for girls and blue for boys)," the statement added.

The agreement was signed between the government, the Spanish Association of Toy Manufacturers and Autocontrol, an independent advertising self-regulatory organisation.

In December the consumer affairs ministry staged a symbolic "strike" by toys at a Madrid park to protest against gender stereotypes.

Consumer Affairs Minister Alberto Garzon has sparked controversy in the past by calling on Spaniards to eat less meat and banning advertising for sweets aimed at children in a bid to fight obesity.

Several other European nations, including France and Britain, have in recent years adopted similar moves to end gender stereotyping in adverts for toys.