Benefits of the HPV vaccine extend beyond those who receive the shots: When young women and girls are vaccinated, unvaccinated young men may be protected from HPV-related cancers, according to new research published Tuesday.

HPV, or human papillomavirus, is the leading cause of cervical cancer, and can also cause other cancers, including cancers of the penis, head and neck.

The new study, in the journal JAMA, found that infection rates of oral cancer-related HPV strains in unvaccinated men decreased from 2.7 percent in 2009-10 to 1.6 percent in 2015-16, reflecting a possible herd immunity effect from the vaccine.

The new findings weren’t a surprise, but they did come as a relief, said a study co-author, Dr. Maura Gillison, a thoracic head and neck oncologist at the University of Texas MD Anderson Cancer Center in Houston.

HPV-positive head and neck cancers are the most rapidly increasing cancers among young men in the U.S., Gillison said. “The HPV vaccine is our best hope to reverse those trends.”

Currently, the Centers for Disease Control and Prevention recommends all people through age 26 be vaccinated against HPV. The vaccine has been recommended for young women and girls since 2006 to prevent genital infections that can lead to cervical cancer, and for young men and boys since 2011 to prevent genital and anal HPV infection.

But there hasn’t been enough clinical data to recommend the vaccine for preventing oral HPV infections, Gillison said.

To take a closer look at the possibility that giving HPV shots to women and girls might help protect unvaccinated men, the researchers analyzed data from 13,676 adult men from four cycles of the National Health and Nutrition Examination Survey (NHANES) in 2009 through 2016. As a part of NHANES, men were asked to swish a mouthwash around in their mouths and then spit into a container. That fluid was then tested for various strains of HPV.

During the study period, HPV vaccination rates increased from 0 percent to 5.8 percent of men, and from 7.3 percent to 15.1 percent of women. At the same time, the rates of oral HPV strains that the vaccine protects against decreased by 37 percent, from 2.7 percent in 2009-10, to 1.6 percent in 2015-16 in unvaccinated adult men.

However, rates of other HPV strains, which the vaccine doesn’t protect against, didn’t decrease in men during the time period, the researchers found.

HPV-related head and neck cancers have been on the rise in men, said Dr. Jonathan Zenilman, a professor of medicine in the infectious disease division at the Johns Hopkins School of Medicine. “Most of these cancers used to be related to drinking and smoking,” Zenilman said. “Now half are related to HPV exposure.” Men end up with HPV infections in their mouth through oral sex.

The new study is “basically showing an indirect benefit of vaccine towards an exposed population,” Zenilman said, or, in other words, herd immunity.

That’s surprising, given that the HPV vaccine is relatively new, and that relatively low rates of the population have been immunized, said Dr. Nina Shapiro, a professor of head and neck surgery at the University of California, Los Angeles, and 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.”

However, people shouldn’t take the new findings as a sign that they don’t need to get vaccinated, Shapiro said. “The cancers associated with this virus are very scary.”

Still, the fact that herd immunity has been observed should be good news to those who cannot get vaccinated, a group that includes “anyone who has a weakened immune system and, like any other vaccine, someone being treated for cancer of any kind,” Shapiro said.

“The bottom line,” Zenilman said, “is that vaccines are good. If you’ve seen someone with cervical or head and neck cancer and that doesn’t convince you, I don’t know what will.”

An earlier version of this article misstated a finding in the JAMA study. It was infection rates of oral cancer-related HPV strains in unvaccinated men that decreased from 2.7 percent in 2009-10 to 1.6 percent in 2015-16. It was not rates of oral HPV-related cancers in unvaccinated men.

Follow NBC HEALTH on Twitter & Facebook.