Massachusetts Gov. Charlie Baker has signed a bill that repeals a series of antiquated state laws, including an abortion ban with roots dating to 1845.

The Republican governor was joined Friday by Democratic lawmakers and other abortion rights advocates at a signing ceremony for the so-called NASTY Women Act — short for Negating Archaic Statutes Targeting Young Women.

Proponents said the repeal was needed to assure abortion remains legal in the state should a more conservative U.S. Supreme Court overturn the 1973 Roe v. Wade ruling that created a nationwide right to abortion.

Massachusetts, according to the group Emily's List, was one of 10 states with pre-Roe abortion bans still on the books.

Baker said Massachusetts "will not compromise on a woman's right to her own decisions."

“As women’s rights are under constant assault on a national level, this vital legislation will ensure Massachusetts remains at the forefront of protecting women and the services they most need,” new Senate President Karen Spilka, an Ashland Democrat, said in a statement.

Also repealed were other archaic laws that have not been enforced for generations, including limits on contraception and bans on adultery and fornication.

In November the governor signed a law insulating Massachusetts from federal changes to birth control coverage under the Affordable Care Act, protecting a woman's right to free contraception.

With reporting by The Associated Press, State House News Service and the WBUR Newsroom