Trump said he was against abortion except in cases of rape, incest or a “serious health risk” to the mother.
His stance on what is a divisive election issue in the US emerged days after Alabama passed a law banning abortion in almost all cases.
A pro-choice rally is planned later on Sunday in protest at the new measures.
Supporters of Alabama’s abortion ban say they expect the law to be blocked in court, but hope that the appeals process will bring it before the US Supreme Court.
They want the highest court in the land – which now has a conservative majority – to overturn the 1973 Roe v Wade ruling making abortion a right across the US.
Sixteen other states are also said to be seeking to impose new restrictions on abortion.
Trump, whose position on abortion has shifted over the years, had been largely silent on the Alabama restrictions until Saturday, when he posted a series of tweets outlining his views.
“I am very strongly pro-life, with the three exceptions – rape, incest and protecting the life of the mother – the same position taken by Ronald Reagan”, he said.
The president added that judicial measures, such as his appointment of conservative Supreme Court judges Neil Gorsuch and Brett Kavanaugh, have helped to make abortion laws in various states more restrictive.
“We have come very far in the last two years with 105 wonderful new federal judges (many more to come), two great new supreme court justices … and a whole new and positive attitude about the right to life.”