The longer a woman takes to get pregnant, the more likely she is to have a boy, scientists suggest.
The gender of your baby may be affected by conditions in the cervix
Dutch researchers analysed data for 5,283 women who gave birth to single babies between 2001 and 2003.
Among the 498 women who took longer than a year to get pregnant, the chance of having a boy was almost 58%, the British Medical Journal study found.
But the proportion of male births among the 4,785 women with shorter times to pregnancy was 51%.
The authors calculate that, for couples conceiving naturally, each additional year of trying to get pregnant is associated with a nearly 4% higher expected probability of delivering a male baby.
This was found to be the case, even after factors such as age, smoking status, alcohol use, and variations in their menstrual cycle were taken into account.
But for the 300 women in couples who had IVF the time it took to get pregnant did not have any relation to the chances of having a boy.
The researchers from Maastrict University, led by Dr Luc Smits, say their findings might explain the disparity between the number of boys and girls born around the world.
The average ratio for countries is 105 boys to 100 girls.
The proportion of X and Y (male) bearing sperm in semen are equal.
But male embryos and foetuses have a higher risk of dying in the womb.
Consequently, scientists have been trying to find out why there are more male babies.
Dr Smits and his team say their work supports the theory that conception depends on how viscous, or "sticky", the mucus in a woman's cervix is.
The stickier it is, the harder it is for any sperm to get through. But Y bearing sperm are lighter, and swim faster.
Therefore, if a woman takes longer to get pregnant, it may be that she has thicker than usual mucus.
This would mean it is harder for any sperm to get through, so conception takes longer.
And, when it does happen, it is more likely to have a boy because of male sperm's swimming abilities.
Dr Smits said: "Women whose cervical mucus is relatively viscous would not only have more difficulties conceiving naturally, but also have a higher probability of male offspring if they do get pregnant.
"This may explain why there is a higher chance, in general, of having boys."
But Professor James Walker, of St James' Hospital, Leeds, said there were other factors which could influence whether male or female sperm were successful in fertilising an egg.
A woman's age and the pH of the vagina also have an effect on which sperm get through, he said.
And he added: "42% of babies born to women trying for more than a year were girls. So it's not true that female sperm are being stopped at the gate."