BOSTON (AP) — Massachusetts Gov. Charlie Baker has signed a bill approving $8 million to offset the potential loss of federal funding to women’s reproductive health organizations under a new Trump administration rule.

Baker said the measure “ensures women’s health providers across Massachusetts will continue to have access to these critical funds” by closing any gap in the family planning program known as Title X.

The Republican signed the bill Friday, a day after the Senate enacted it on a 33-5 vote. The House approved it by a 140-14 vote on Wednesday, where 20 Republicans joined the vast majority of Democrats to back it.

The new federal rule, derided as a “gag rule” by critics, would prohibit federally funded family planning clinics from making abortion referrals or sharing office space with abortion providers.