BOSTON -- Massachusetts Gov. Charlie Baker signed a law on Monday requiring state insurers to cover birth control without a copay.

"This legislation will ensure no woman in Massachusetts, irrespective of what goes on in Washington, will worry about whether her health care services and rights will be affected here in the commonwealth," Baker, a Republican, said after signing the bill at a ceremony in the State House library.

Currently, under the Affordable Care Act signed by former President Barack Obama, insurers are required to cover contraceptives without cost-sharing. But Republican efforts to repeal the ACA mean the future of that requirement is uncertain.

The main impact of the Massachusetts law will be to impose a state-level requirement so that women continue to get free birth control even if the Affordable Care Act is repealed or changed.

The law will also guarantee birth control access to women without copays despite a policy put in place by President Donald Trump that lets any employer with a religious or moral objection to birth control deny contraceptive coverage to employees. The Massachusetts bill includes a religious exemption for churches.

House Speaker Pro Tempore Pat Haddad, D-Somerset, said the bill became a priority "not just because of what it does but because of the potential for things to change dramatically for women of Massachusetts."

With the law's passage, "There will be women we'll never know about who are able to make decisions on how large their family is, when to start their family, regardless of economic condition," Haddad said.

The new law will also require insurers to pay for a 12-month supply of prescription birth control pills after a three-month trial period. Insurers now often cover only one or three months at a time, so women must go to the pharmacy regularly to reorder their medication.

Jennifer Childs-Roshak, president of Planned Parenthood Advocacy Fund of Massachusetts, said as a family doctor, she has seen patients with high copays who cut birth control pills in half, delay refills or skip birth control altogether. Some used less effective methods of birth control because they could not afford long-lasting contraceptives, like an IUD.

"Everyone deserves the ability to stay healthy, plan their families and focus on their future - no matter who they are, where they live or who they work for," Childs-Roshak said.

The final bill was the result of negotiations between insurers and women's health advocates, and it has support from both groups.

Lora Pellegrini, president of the Massachusetts Association of Health Plans, said in a statement, "Efforts at the federal level to limit access to contraceptives have created unnecessary uncertainty for millions of Massachusetts women. This law offers a sensible approach that will provide women in the Commonwealth with the confidence that they will continue to have access to this important benefit regardless of what happens in Washington, while being mindful of our state's focus on cost containment."

The law requires insurers to cover at least one version of every type of FDA-approved birth control -- so for example, an insurer can charge a copay for a brand-name drug if there is a generic equivalent with no copay. If a patient's doctor specifies that the patient must get a particular type of birth control, the insurer would have to cover that without a co-pay. The law includes pills, devices, emergency contraception and female sterilization procedures.

Attorney General Maura Healey said the law "is about the fact that every woman should have access to affordable and reliable basic health preventative services, including birth control."

"The federal administration seems set on taking women backwards, holding them back," Healey said. "It's wonderful to see Massachusetts make a statement that we're not going to stand for it."

Senate Majority Leader Harriette Chandler, D-Worcester, said, "If Washington is going to be hostile towards programs that are working, we need to be prepared. When given a chance to make these programs work even better -- to ensure that they're entrenched and enforced and even more accessible -- we're going to seize that opportunity to advance women's health."

A report by the Center for Health Information and Analysis found that mandating birth control coverage will add between 7 cents and 20 cents to monthly health insurance premiums and cost the health care system between $1.9 million and $5.7 million annually.

Baker, in his budget proposal, had suggested a temporary moratorium on new health insurance mandates. Asked about that, Baker said a moratorium has been used on and off for years as a way to put in place a process before any new mandate is passed to ensure people know what it will cost.

"In this particular case, there was a tremendous concern about a particular issue that involved the uncertainty associated with federal policy, and I think it's terrific that everybody got together and got this done to protect women's reproductive rights here in Massachusetts," Baker said.

Insurers have six months to develop contracts that comply with the new law.