In 2007, the District of Columbia became the second place in the nation to require that schoolgirls be immunized against the human papillomavirus, or HPV, responsible for cervical cancers that kill 4,000 American women a year.

It was controversial then, with a few activists loudly protesting that the vaccine is unproven and risks girls’ health for pharmaceutical company profit. It remains controversial now, with several Republican presidential candidates hammering rival Texas Gov. Rick Perry on similar grounds for ordering a since-overturned vaccine mandate in his own state.

But the science is clear. The most trusted medical institutions, including the Food and Drug Administration and the Centers for Disease Control and Prevention, agree that the HPV vaccine is a safe and effective way to prevent a devastating disease that is hard to detect and harder to treat. As of June, more than 35 million doses of the vaccine had been administered in the United States, according to the CDC, with no pattern of serious side effects.

But the District is proving that law alone isn’t been enough to guarantee widespread use of a life-saving vaccine.

CDC data released earlier this year show that girls in D.C. are indeed among the most likely in the country to have received the first dose of three required for a successful vaccination. But the city, when compared with states, falls to the middle of the pack when considering how many continue the series.

The authors of the city’s vaccine law were aiming for a bit better than middle of the pack.

D.C. Health Department data on the sixth-grade girls subject to the law paint an even more concerning picture.

For the first class of girls to fall under the vaccine requirement, now eighth-graders, only 23.5 percent are fully compliant — that is, they’ve started the series and aren’t overdue for subsequent doses.

For the second class, now seventh-graders, only 18.1 percent are on schedule. In both classes, waivers are popular: Parents of more than 40 percent of the girls have opted out of the shots altogether. And the remainder of students have either started their shots without completing them, or they simply haven’t gotten the shots or filled out a waiver.

All told, it appears less than a quarter of the girls that lawmakers were aiming to protect are actually being protected.

“I’m very upset about it,” said Richard A. Levinson, the Health Department’s chief of community health. “And I’m especially alarmed that many of them resist it because of incorrect information, which is very widespread out in the community.”

Some of what’s out there, Levinson said, is what can be heard out of the mouths of certain presidential candidates — unfounded allegations that the vaccine can be deadly or cause mental retardation.

This summer the city has moved to combat the misinformation, hiring a contractor to go into traditional public and charter schools and explain to students, parents and teachers what the vaccine is, that it’s safe and that it might well save many from an early, painful death.

But other experts say emphasis must go on making the HPV vaccine easier and more routine. Elyse Kharbanda, a researcher with Minneapolis-based HealthPartners Research Foundation who has investigated why parents choose the HPV vaccine for their daughters, said that its low uptake in D.C. is in part because it isn’t being treated like other vaccines.

For reasons that have more to do with politics than medicine, the District’s law includes a permissive opt-out provision, requiring only a parent’s signature to forgo the vaccine. For other potentially life-saving vaccines, they’re much harder, if not impossible, to avoid. Kharbanda said the policy sends the message that the HPV vaccine — which can be expensive and inconvenient — is all right to skip.

“When you don’t have an easy opt-out, it sort of pushes things up on your priority list,” she said. “I think people are very busy, myself included, and [an optional vaccine] is not your top priority.”

And Noel Brewer, a professor of public health at the University of North Carolina who has also studied HPV vaccine use, said the public controversy has been less harmful than the fact that many doctors simply don’t know or choose not to recommend it, or that many parents have insurance plans that don’t cover the vaccine or charge large co-pays for it.

The law, Brewer said, is “a good idea, but it’s clearly not enough.”

Levinson admitted that it has not been “terribly successful” as implemented, but he said he expects modest progress in the coming years as more parents accept the vaccine as routine. The mandate will help, he said.

“You’re always faced with the fact that there is a law that requires it,” he said. “Having it on the agenda, having it there, and having people ask why should we take it, I think it has helped immensely.”