A man's sexual orientation may be determined by conditions in the womb, according to a study.
Scientists think antibodies produced in the womb may be responsible
Previous research had revealed the more older brothers a boy has, the more likely he is to be gay, but the reason for this phenomenon was unknown.
But a Canadian study has shown that the effect is most likely due to biological rather than social factors.
The research is published in the journal of the Proceedings of the National Academy of Sciences.
Professor Anthony Bogaert from Brock University in Ontario, Canada, studied 944 heterosexual and homosexual men with either "biological" brothers, in this case those who share the same mother, or "non-biological" brothers, that is, adopted, step or half siblings.
He found the link between the number of older brothers and homosexuality only existed when the siblings shared the same mother.
The amount of time the individual spent being raised with older brothers did not affect their sexual orientation.
Writing in the journal, Professor Bogaert said: "If rearing or social factors associated with older male siblings underlies the fraternal birth-order effect [the link between the number of older brothers and male homosexuality], then the number of non-biological older brothers should predict men's sexual orientation, but they do not.
"These results support a prenatal origin to sexual orientation development in men."
He suggests the effect is probably the result of a "maternal memory" in the womb for male births.
A woman's body may see a male foetus as "foreign", he says, prompting an immune reaction which may grow progressively stronger with each male child.
The antibodies created may affect the developing male brain.
In an accompanying article, scientists from Michigan State University said: "These data strengthen the notion that the common denominator between biological brothers, the mother, provides a prenatal environment that fosters homosexuality in her younger sons."
"But the question of mechanism remains."
Andy Forrest, a spokesman for gay rights group Stonewall, commenting on this and other studies, said: "Increasingly, credible evidence appears to indicate that being gay is genetically determined rather than being a so-called lifestyle choice.
"It adds further weight to the argument that lesbian and gay people should be treated equally in society and not discriminated against for something that's just as inherent as skin colour."