Virginia women will be able to have their insurance provider cover a full year of birth-control pills at once under a bill signed Wednesday by Gov. Terry McAuliffe at an Arlington County clinic.

McAuliffe (D), surrounded by about a dozen elected officials and more than 50 women’s rights advocates, said he was happy to sign what he called the first positive women’s reproductive health measure to emerge from the legislature in his term.

“I’ve spent these years blocking and tackling, stopping the most insane anti-women legislation you can imagine,” he said after the event at the Arlington County Stambaugh Human Services Center Clinic. “This is why elections do matter.”

The bill-signing had the feel of a campaign rally as the ebullient governor bounded into the packed room to a round of applause and joined a crowd of state and local elected officials at the dais. He was introduced by Lt. Gov. Ralph Northam (D), who hopes to succeed McAuliffe in the governor’s mansion in November.

McAuliffe touted the candidacy of Northam, who is battling former congressman Tom Perriello for the Democratic nomination, and gave a shout-out to Democrats in the House of Delegates, who helped sustain the record 111 vetoes he has issued during his term.

“If I lost one Democrat in the House of Delegates, one single vote, I would have been overridden. They stood with me,” McAuliffe said.

When the new law takes effect July 1, Virginia will join five other states — Oregon, California, Hawaii, Illinois and Vermont — and the District of Columbia in requiring insurance companies to cover 12 months of birth control at a time.

The legislation was sponsored by Del. Eileen Filler-Corn (D-Fairfax), who said it will help women avoid gaps in birth-control use. It passed both chambers in the Republican-controlled legislature with large bipartisan majorities.

Representatives for health insurers questioned whether the law was necessary, noting that current insurance policies allow people to get 90-day prescriptions and ask for automatic refills.

Advocates called the 12-month birth-control measure a “common-sense” measure that will make it easier for women to stay on the medication.

They cited studies that say having access to 12 months of birth-control pills could reduce the rate of unintended pregnancies by 30 percent and decrease by 46 percent the odds of having an abortion.

A similar bill failed to get out of committee in 2016. The difference this year was that Filler-Corn personally lobbied Republicans, said Tarina Keene, executive director of NARAL Pro-Choice Virginia.

In addition, women’s advocates, accompanied by three physicians, talked with lawmakers who had opposed the bill a year earlier.

“It just makes sense that women have consistent, reliable access to birth control so they can control their reproductive destiny,” Keene said. “It’s much cheaper to supply a woman with a year’s worth of birth control than cover an unexpected childbirth.”