Flowering crops such as beans and cotton offer their sweetest nectar to recruit colonizing ants in a strategy that balances their need for defense and to reproduce, research suggests.

So-called ant-plants carefully manage the amount and sweetness of nectar produced on their flowers and leaves, a study shows.

This enables them to attract ants -- which aggressively deter herbivores -- while also luring insects that will spread pollen.

The findings could inform the commercial farming of produce from ant-plants, which also include pumpkins, courgettes, passionfruit and acacia honey.

Researchers from the University of Edinburgh studied the nectar secreted by a plant from the passionfruit family during flower and fruit development.

They sought to understand how such plants produce nectar on their flowers, fruits and leaves, to feed ants and pollinators.

Scientists were surprised to find that the greatest volume of sweetest nectar was produced surrounding flowers, to attract ants.

This may ensure that flowers, with their valuable pollen and potential fruits, are well defended from herbivores, while encouraging ants to stay away from the open flowers themselves.

Researchers had expected high secretions of nectar at buds and fruits to lure ants, but not at flowers, in order to avoid conflicts between ants and pollinators. The study, published in Biotropica, was funded by the National Autonomous University of Mexico.

Nora Villamil-Buenrostro, of the University of Edinburgh's School of Biological Sciences, who led the study, said: "Offering sweet bribes in the form of nectar may be a strategy used by ant-plants to avoid conflict between ants and pollinators. This allows a trade-off in which plants are well defended by bodyguard ants, without these scaring away pollinators."