Genes play just a small role in whether a person is gay, scientists have found, after discovering that environment has a far bigger impact on homosexuality.

In the biggest ever study into the genetic basis of sexuality, researchers from more than 30 institutions including Cambridge University and Harvard, looked at the DNA of nearly 500,000 people in Britain and the US.

They found that genes are responsible for between eight to 25 per cent of the probability of a person being gay, meaning at least three quarters is down to environment.

Scientists said it worked in a similar way to height, in which genes are partly responsible, but other factors - such as nutrition - also play a major role, adding or knocking off inches.

In this case, environment could mean anything from being exposed to certain conditions in the womb, to differences in upbringing or education.

Although the research may seem controversial, suggesting that homosexuality is not primarily ‘written in the genes’, the scientists say it does not mean that sexuality it a choice or can be altered.

“Some people will misunderstand or even deliberately twist our findings,” said senior author Dr Ben Neale, a statistical geneticist at Harvard Medical School.