A woman's body can reject a male fetus although it's not typical.
Research has found that women that have given birth to a boy may also be more likely to have a miscarriage in their later pregnancies.
It's thought that the reason for the woman's body rejecting a male fetus and leading to miscarriage is due to the mother's immune system developing antibodies against the male specific H-Y antigens.
These male specific H-Y antigens are proteins that are associated with the Y chromosome.
It's rare that a woman's body rejects a male fetus though and many women of course become pregnant with male fetuses and give birth to healthy male newborns.
When a woman's body does reject a male fetus it usually occurs it often occurs after the woman gives birth to a male baby.
Male fetuses produce H-Y antigens, which are proteins that are found on the surface of cells.
During the first pregnancy, the mother's immune system can become sensitized to the antigens.
And the mothers' immune system can then produce antibodies against the antigens and can cause the woman's body to attack the fetus in future pregnancies.
The development of the antibodies against H-Y antigens is thought to be a contributing factor to the increased risk of miscarriage in any subsequent pregnancies, especially if the fetus is also a male fetus.
It doesn't always happen though and many women who have given birth to a baby boy do not experience any problems with later pregnancies including of baby boys.
A significant portion of early miscarriages are a result of chromosomal problems in the fetus.
And older mothers are also slightly at higher risk for miscarriages.
And even some genetic predispositions can also increase the woman's risk of miscarriage.
Other factors that can result in miscarriage include stress, drug use, smoking and excessive alcohol consumption.