A California woman became pregnant while she was already pregnant, in an extremely rare case that resulted in her carrying "twins" with two different sets of parents.

The 31-year-old woman, Jessica Allen, agreed to be a gestational surrogate for a Chinese couple that she met through a surrogacy agency in southern California, according to the New York Post. In April 2016, doctors used in vitro fertilization to produce an embryo for the Chinese couple, and implanted that embryo in Allen's uterus.

Allen soon became pregnant with the other couple's baby, but at six weeks of pregnancy, she was told she was carrying twins. Allen "was very surprised" to learn she was carrying two babies, she told ABC News. She believed the Chinese couple's embryo had split in two, making the twins identical, she said.

A month after she had given birth to the two babies, she learned that the "twins" were not identical. They looked different, and a DNA test confirmed that one baby was Allen's biological child and the other baby was the Chinese couple's child.

"It turned out that, in an extremely rare medical incident called superfetation, we had gotten pregnant naturally" after the IVF procedure, Allen told the New York Post. [9 Uncommon Conditions That Pregnancy May Bring]

Superfetation means that a woman becomes pregnant while she is already pregnant. It's extremely rare — fewer than a dozen cases of superfetation have been reported in the medical literature, said Dr. Saima Aftab, medical director of the Fetal Care Center at Nicklaus Children's Hospital, who was not involved in Allen's case.

Usually, when a woman becomes pregnant, several biological processes kick in that prevent her from getting pregnant a second time during the pregnancy: Her body releases hormones that halt ovulation (the release of an egg from the ovaries); a "mucus plug" develops in the cervix, which prevents sperm from traveling to the uterus; and the lining of the uterus changes, making it hard for another embryo to implant, Aftab said.

But with superfetation, a woman continues to ovulate after she becomes pregnant, and her ovaries release another egg that is then fertilized, resulting in a second pregnancy. It's important to note that, with superfetation, the two fetuses are different gestational ages, typically just a few weeks apart, Aftab said. This is different from fraternal twins, in which two eggs are fertilized at the same time, and the fetuses are the same gestational age.

Aftab said it's possible that superfetation happens more often than is reported; the condition may go undetected because the two fetuses are so close in age that they are simply considered twins. It's only when doctors can detect clear differences in the maturity of the fetuses — or when, as in Allen's case, the babies have different parents (or a different father) — that these cases are easier to detect, Aftab said.

Allen said she was "floored" when she learned one of the babies was hers. "I carried my own child. I didn't know he was mine," Allen told ABC News.

Allen said she underwent a complicated legal battle to get custody of her son, who was not legally her child when he was born. In February, Allen and her husband, Wardell Jasper, got custody of their son, whom they named Malachi.

Because superfetation is so rare, it's difficult to know whether IVF procedures, or surrogacy, can influence the likelihood of the condition, Aftab said. But these could be questions for future research.

In the meantime, this case should be a "reason for pause and thoughtfulness" among physicians and surrogacy organizations, Aftab said. In future surrogacy cases in which a twin pregnancy occurs unexpectedly, it would be in the interest of all parties to rule out superfetation as soon as possible, she said.

Original article on Live Science.