Homosexual behaviour is typical in most animals.
Scientists have studied homosexual acts in over 1,500 species - ranging from apes to spiders - and have theorised that same-sex displays have evolved to increase social bonding.
A study led by Spain's Estacion Experimental de Zonas Aridas discovered that gay behaviour is equally common in both male and female animals.
The experts reviewed the scientific research related to same-sex behaviour in animals and created a database for their findings.
Analysis showed that gay behaviour was more likely to evolve in social species as such actions help the creatures to establish and keep positive relationships.
The researchers wrote in their paper: "Since it does not contribute directly to reproduction, same-sex sexual behaviour is considered an evolutionary conundrum.
"Our analysis suggests that it may play an adaptive role in maintaining social relationships and mitigating conflict."