Researchers at Cardiff University have helped locate the genes which can make women more vulnerable to severe mental illness just after childbirth.
The discovery could lead to new treatments for the condition, known as postpartum psychosis, scientists said.
The condition is one of the most severe forms of mental illness and there is an increased risk of suicide.
Women with bipolar disorder are often affected with one in three deliveries followed by an episode of the illness.
Postpartum psychosis is not the same illness as postnatal depression.
It comes on in some women within a few days of giving birth.
It is also a less common disease than postnatal depression, affecting approximately one woman in 500, but is more severe in its effects.
The study, funded by the Wellcome Trust, and involving a collaboration between Cardiff University, Birmingham University and Trinity College, Dublin, has helped pinpoint the genetic cause of the disease.
The team examined the DNA of families in which at least one woman had suffered with an episode of postpartum psychosis.
The researchers found the location of the genes involved in the illness and are now homing in on the genes themselves.
WHAT IS POSTPARUM PSYCHOSIS?
Also known as puerperal psychosis or postnatal psychosis
It can take the form of mania, severe depression and delusions, confusion or mood swings
The condition can make it difficult for a woman to bond with her baby
There is some evidence that the condition runs in families
It is slightly more common in first pregnancies
The research will help pave the way towards improved identification of women at risk and better treatments for women who suffer episodes following childbirth.
Postpartum psychosis is currently treated in hospitals with antipsychotic drugs or antidepressants.
It can take some women a long time to recover completely, although many recover within a few weeks.
Co-leader of the research, Dr Ian Jones from Cardiff University School of Medicine, said it was vital that women at high risk of severe postpartum illness were aware of the condition.
"Although a lot of work still needs to be done, this study will lead to significant benefits for women vulnerable to becoming ill following childbirth," he said.
"Many of the medications used to keep women with bipolar disorder well can be a problem in pregnancy.
"Finding these genes will allow us to better identify bipolar women at very high risk and will help them and their doctors make the difficult decisions about taking medications through pregnancy."
The team's findings have been published this week in the American Journal of Psychiatry.