Women who use marijuana during pregnancy are putting their babies at risk, a study published Thursday finds.

Babies born to women who were heavy cannabis users during pregnancy are more likely to have health problems, including premature birth and death within a year of birth, compared to babies born to women who did not use cannabis during pregnancy, according to an analysis of nearly 5 million California women who gave birth between 2001 and 2012.

“Because many states in the U.S. now have approved medical and/or recreational cannabis, we recommend regulatory approaches targeting pregnant women, such as developing guidelines for physicians to appropriately recommend medical cannabis and communicating potential risks of prenatal cannabis use,” said the study’s lead author, Yuyan Shi, an associate professor of health policy and health economics at the Herbert Wertheim School of Public Health and Human Longevity Science at the University of California, San Diego.

Another approach would be to require dispensaries to display warning signs and for cannabis products to include warning labels of potential dangers to fetuses, she said in an email.

Shi and her colleagues reviewed the medical records of 4.83 million mother-infant pairs, which included 20,237 in which the delivery record noted that the woman had a diagnosis of either “cannabis dependence” or “nondependent cannabis abuse” — suggesting much more than occasional use.

The researchers matched the marijuana users with 40,474 pregnant women whose records showed no indications of cannabis use, by factors such as demographics, physical health conditions, mental health conditions and behavioral health conditions.

When they compared infant outcomes from the two groups, they found that babies born to women who used cannabis frequently were 6 percent more likely to be born premature, 13 percent more likely to have a low birthweight and 35 percent more likely to die within their first year.

The finding that babies whose mothers used cannabis were more likely to die within the first year, “I have not seen before,” said Dr. Nora Volkow, director of the National Institute on Drug Abuse, which provided funding for the research.

The study has two major strengths, including the large number of women analyzed and the focus on heavy exposure, experts say. “In the past, effects of smoking during pregnancy have not made an attempt to quantify whether it was regular use or use in high doses,” Volkow said.

To participate, the women have to be taking or have taken the drug at least three times a week during the first trimester and be willing to keep a diary that details exactly what product they bought and how they were consuming it.

“We are trying to track their marijuana uses pretty carefully and we’re also doing drug testing to make sure the women aren’t using any other substances,” the study’s lead researcher, Natalia Kleinhans, a neuropsychologist and an associate professor at the University of Washington, told.

There will be a comparison group of expectant women who aren’t using marijuana, but might have a prescription for an anti-nausea medication. Six to nine months after the babies are born, the researchers plan to do brain scans to see if they can detect any impact marijuana might have had on their brains.

There are cannabinoid receptors distributed throughout the human brain and other organs, so understanding how the drug affects the fetus is crucial. “Marijuana use is going to stimulate those receptors at a crucial stage of development,” Volkow said. “That may be part of the reason we are seeing those changes.”

The new study underscores the potential dangers of using cannabis during pregnancy, said psychiatrist Ziva Cooper, director of the UCLA Cannabis Research initiative at the Jane and Terry Semel Institute.

Future studies should look at whether women are consuming edibles, smoking or vaping the drug and to get a clearer picture of exposure to THC, the psychoactive component of marijuana, she said.

Given the increasing numbers of pregnant women using cannabis to combat nausea, this is an important study, said Renee Goodwin, a professor of epidemiology at CUNY and an adjunct professor of epidemiology at Columbia University’s Mailman School of Public Health.

“This study is unique in that they’re trying to get at heavy use,” she said. “Marijuana has not been evaluated for safety, and we know it does have potential negative effects on the newborn,” Volkow said.