The chickenpox vaccine appears to offer benefits beyond keeping the childhood illness at bay: It may also significantly reduce a child’s risk of shingles, a large study released Monday finds.

In the study, published in the journal Pediatrics, researchers reviewed the medical records of more than 6 million children, and found that those who did not get the chickenpox vaccine were over four times more likely to develop shingles before age 17 than those who were vaccinated.

Chickenpox and shingles are caused by the same virus, the varicella zoster virus. After a person is infected with chickenpox, the virus goes into hiding in the body and can reactivate later, causing shingles. While shingles is most commonly seen in people aged 50 and up who had chickenpox as children, it does sometimes occur in children and teens.

The results of the massive study show that “there is a dual benefit of vaccination,” said the study’s lead author, Sheila Weinmann, a senior investigator at Kaiser Permanente Northwest Center for Health Research. “The take-home message for parents is that the varicella vaccination reduces risk of shingles as well as chickenpox in children.”

That’s also good news for the adults out there who got vaccinated against chickenpox as kids. It means they won’t have to worry as much about getting shingles when they hit their 50s, experts told NBC News.

In the study, the researchers looked at the medical records of more than 6 million children and teenagers. About 3 million had received the chickenpox, or varicella, vaccine, and about 3 million had not. (The large number of unvaccinated kids in the study is because many of them had not gotten the vaccine, which was introduced in 1995.)

During the 12-year study period, the researchers found that 9,044 of the unvaccinated children developed shingles, compared with 5,339 of the vaccinated children.

Another way to look at those numbers is to calculate how many children out of 100,000 would get shingles, Weinmann told NBC News. By that tally, among the unvaccinated children, 170 out of 100,000 developed shingles, compared with 38 out of 100,000 among the vaccinated kids, she said.

Chickenpox and shingles

Weinmann said that there are three possible explanations for why children who get the chickenpox vaccine would get shingles.

First, you could be infected with a different strain of chickenpox virus after being vaccinated, and the vaccine doesn’t protect against that strain. “No vaccine is 100 percent effective,” Weismann said.

Second, you may have already had the chickenpox before getting vaccinated, but the case was too mild to notice, she said.

Finally, “you could get shingles from the live attenuated virus in the vaccine,” she said. (A “live attenuated virus” refers to the weakened form of the virus in the vaccine.)

An attenuated virus, such as the one used in the varicella vaccine, is a strain that has been engineered to be so weakened that it can’t make you sick when you get the vaccine, said Dr. Tina Tan, a professor of pediatrics at Northwestern University’s Feinberg School of Medicine and an infectious disease specialist at the Robert H. Lurie Children’s Hospital. It’s just similar enough to the regular virus to alert your immune system to make antibodies that can fight the virus in the future, but apparently, in a small number of cases, that weakened form of the virus could to lead to shingles, Tan told NBC News.

But the study should reassure parents that it’s highly unlikely this would happen.

The research “proves that the varicella vaccine really does prevent [shingles],” said Tan, who was not involved with the study. “There was some hint of this when they did clinical trials, but with millions of children, this study presents really strong evidence.”

Dr. Nina Shapiro, a professor at the University of California, Los Angeles, School of Medicine and the director of pediatric otolaryngology at UCLA, told NBC News that she was also impressed with the new findings.

Doctors have thought that getting the chickenpox vaccine would reduce a person’s risk of shingles later, and “this study demonstrates, with a large population, that the vaccine is highly protective,” said Shapiro, who is the author of “Hype: A Doctor's Guide to Medical Myths, Exaggerated Claims, and Bad Advice — How to Tell What's Real and What's Not.”

What’s more, it’s likely that as the years go by and there is a larger percentage of older folks who got the vaccine as kids, that shingles will become less common, Shapiro said.

FOLLOW NBC HEALTH ON TWITTER & FACEBOOK