President Donald Trump distanced himself from far-reaching legislation approved in Alabama last week that would enact a near-total ban on abortion.

In a series of tweets late Saturday, Trump said he supported exceptions to abortion in cases where it is necessary to save the life of the woman, or if the pregnancy arises from incest or rape.

Trump, who years before becoming a politician had supported abortion rights, noted that he now holds “the same position taken by” former President Ronald Reagan.

Alabama Gov. Kay Ivey (R), in a move that put a nationwide spotlight on the issue, signed into law on Wednesday controversial legislation that makes it a felony in the state for a doctor to perform an abortion in virtually all cases, including rape and incest. The law is set to become effective within six months of her signature, but it’s expected to face a host of legal challenges.

“No matter one’s personal view on abortion, we can all recognize that, at least for the short term, this bill may... be unenforceable,” Ivey said in a statement upon signing the bill, noting the 1973 Supreme Court Roe v. Wade decision that affirmed a woman’s right to an abortion.

Though the Alabama law stands as the nation’s most sweeping ban on abortions, several other states ― such as Mississippi, Ohio, Georgia, Kentucky, Arkansas, Utah, Louisiana and Missouri ― have enacted new laws or are close to doing so that significantly curtail the procedure.

Opponents of the bills see them as clear attempts to overturn Roe with Trump appointee Brett Kavanaugh as the newly installed fifth conservative vote on the Supreme Court.

In his Saturday tweets, Trump urged his fellow Republicans to “stick together” on the issue of abortion, suggesting the extreme Alabama law would unnecessarily divide the party ahead of the 2020 election.

“The Radical Left, with late term abortion (and worse), is imploding on this issue. We must stick together and Win for Life in 2020. If we are foolish and do not stay UNITED as one, all of our hard fought gains for Life can, and will, rapidly disappear!” he tweeted.

Sen. Mitt Romney (R-Utah) similarly distanced himself from the Alabama statute in a Sunday interview on CNN.

“I don’t support the Alabama law,” Romney said. “I think something much more toward the center makes a lot more sense.”