The Democratic-controlled Maine Legislature gave final approval Friday to a bill that would protect health care workers who provide abortion and gender-affirming care from legal action brought in other states.

If signed by Democratic Gov. Janet Mills, Maine would join more than a dozen states that shield medical providers and others from out-of-state investigations regarding abortions. Republican were firmly against the bill to shield against out-of-state lawsuits.

The Maine Senate voted 21-13 on Friday, a day after a 76-67 vote in the House.

The votes came after attorneys general in 16 states, including Tennessee, threatened legal action if Maine proceeded with a shield law preventing out-of-state repercussions for those who provide abortions and what they described as “gender transition surgeries for children.”