BOSTON — The Massachusetts Senate on Tuesday voted to override the Republican governor’s veto of legislation that expands access to abortion in the state, making the measure law.

The Democratic-controlled Senate’s 32-8 override came a day after the Democratic-controlled House similarly voted to override Gov. Charlie Baker’s veto 107-46.

The bill, known as the Roe Act, codifies abortion rights into state law, allows abortions after 24 weeks of pregnancy in cases where the child will not survive after birth, and lowers from 18 to 16 the age at which women can seek an abortion without consent from a parent or guardian.

Baker, in vetoing the legislation last week, said while he strongly supports many provisions of the measure, he could not support expanding the availability of later-term abortions and permitting 16- and 17-year-olds to get an abortion without parental consent.

“Beginning today, pregnant people who once faced near-insurmountable barriers accessing abortion care can now seize the right to control their own bodies,” said state Sen. Harriette Chandler, a Worcester Democrat and sponsor of the bill, said in a statement.

The legislation was opposed by the Catholic Action League, Massachusetts Citizens for Life, and other pro-life groups.

“In an elitist gesture that not only ignored the governor’s commonsense rejection of special interests items in a state budget bill, but also tens of thousands of their constituents vocal opposition, the Legislature has sent a clear message to Massachusetts citizens: We work for the abortion lobby, not for you or the public health,” Massachusetts Citizens for Life said in a statement.

The measure lets women obtain an abortion after 24 weeks of pregnancy in cases of “fatal fetal anomalies.” Current state law allows abortions after 24 weeks only to preserve the life or health of the mother.

The measure also codifies the right to an abortion in state law in response to concerns about the future of Roe v. Wade, the landmark U.S. Supreme Court ruling protecting abortion rights nationwide.