Scientists from the Victor Chang Institute in Sydney investigated why some women have multiple miscarriages and why some babies are born with heart, kidney and spinal defects.
They found a major cause was a deficiency of a vital molecule known as NAD, which is important for normal development of organs.
Lead researcher Professor Sally Dunwoodie said it was the first time NAD been associated with miscarriages and birth defects.
"We have discovered a whole new cause of birth defects and a way to treat it as well," she said.
"Arguably, it's the most important discovery for pregnant women since folate.
"The promise is that this could significantly reduce the number of miscarriages and babies born with defects."
Discovery could help millions of women
NAD is usually formed in the body as part of a healthy diet that includes eggs, cheese, salmon, turkey, nuts and seeds.
But you can also get it by taking supplements of vitamin B3.
The head of the Victor Chang Institute, Professor Bob Graham, said the discovery could potentially help millions of women around the world.
"What's exciting for me is that we may be able to help people who have children who have developmental defects or who have had miscarriages," he said.
In a study published in the New England Journal of Medicine, the team proved birth defects and miscarriages could be overcome by taking vitamin B3.
"We gave pregnant mice with the NAD gene knocked out a regular dose of vitamin B3 and we found it prevented miscarriages and birth defects, over-riding the genetic block," Professor Dunwoodie said.
Scientists optimistic but cautious about discovery
Clinical geneticist David Amor, from the Royal Children's Hospital in Melbourne, said the key finding was the mechanism that a genetic deficiency of NAD could cause birth defects.
"What is most interesting is that these defects are potentially treatable if the mother is given niacin [vitamin B3] supplementation during pregnancy," he said.
And while vitamin B3 was shown to prevent birth defects in mice, he said whether it was the case in humans was yet to be determined.
Telethon Institute's Carol Bower called it an "exciting advance" but said it was not clear if a lack of vitamin B3 was the only cause of birth defects.
"It's not yet clear whether other malformations may be linked to this cause and whether dietary supplementation with niacin [vitamin B3] in humans would prevent this," Professor Bower said.
The Australian Medical Association (AMA) said it was an exciting development but may be premature to compare it to the discovery about folate.
"Most miscarriages are caused by chromosomal abnormalities which are not caused by a vitamin deficiency or a mineral deficiency, so it's not modifiable," said the AMA's president Michael Gannon.
An 'amazing future' for babies and their families
Memphis Jackson is just like any eight-year-old. He enjoys playing computer games and kicking a ball with his brother Cayliss.
But he's had to endure much more than most children.
He was born with hypoplastic left heart syndrome, where the left side of the heart can't adequately supply blood because the lower left chamber is too small and the left hand side valves don't work properly.
This is the kind of birth defect that could be prevented in the future by women taking vitamin B3.
His dad, Craig Jackson, said Memphis's diagnosis came as a huge shock for the family.
"As first-time parents, only young, we were extremely taken aback, so it was a very confronting thing to deal with," he said.
While Memphis is well now, he may need a heart transplant when he is older.
Mr Jackson likens it to having a little Toyota Corolla engine in a big Landcruiser.
"Memphis has only got half a heart — so his half a heart is doing that work that our whole hearts do, so sooner or later it's going to burn out and stop working," he said.
Memphis's mother Tashan said being able to prevent heart defects like her son's would be amazing.
"Knowing that this breakthrough could mean that no babies are born with heart defects in the future, it just makes our hearts sing," she said.
"You can't put into words how amazing that is for the future of babies."
What does this mean for vitamin B3 and pregnant women?
Studies from the United States have shown up to a third of women have low levels of NAD in their blood and aren't getting enough B3 vitamin in their pregnancy supplements.
Scientists say women should take the recommended daily amount of B3 for pregnancy, which is 18 milligrams per day.
But Professor Dunwoodie said women who have problems absorbing nutrients, including those with diabetes, a high body-mass index or inflammatory bowel disease, may need a larger amount.
She said researchers would now start working on a test to measure a woman's NAD levels.
"The goal is to have a quick and easy test that could be done at the same time as a pregnancy test, either in urine or blood," she said.
The breakthrough was made possible by a grant from the National Health and Medical Research Council and philanthropic donations to the Victor Chang Institute, including the Chain Reaction Foundation, Key Foundation and the NSW Office of Health and Medical Research.