Abortion rights will be formally codified in state law and access to the procedure will be expanded after the Senate on Tuesday joined the House in overriding Gov. Charlie Baker's veto of the legislation.

The Senate reaffirmed its support for the abortion access measures (H 5179) on a 32-8 vote, one day after the House's 107-46 vote.

The bill, initially passed within the state budget and then returned by Baker with amendments that lawmakers ultimately rejected, will allow abortions after 24 weeks of pregnancy in cases with a fatal fetal anomaly and if "necessary, in the best medical judgment of the physician, to preserve the patient's physical or mental health." It would also lower from 18 to 16 the age at which individuals can seek an abortion without consent from a parent or a judge.

"Beginning today, pregnant people who once faced near-insurmountable barriers accessing abortion care can now seize the right to control their own bodies," said Senate President Emerita Harriette Chandler, who filed one of the bills on which the budget language was based. She said supporters had been pushing for the changes for two years.

The ROE Act Coalition said the reforms mean that "no Bay State family who receives a devastating diagnosis later in pregnancy will ever be forced to fly across the country to access compassionate care and no 16- or 17-year-old will ever be forced to navigate the court system to access the health care they need."

In his veto message last week, Baker said he "strongly" supports the right to access reproductive health care but could not support sections "that expand the availability of later term abortions and permit minors age 16 and 17 to get an abortion without the consent of a parent or guardian."