The law includes a ban on abortion in cases of rape or incest.
Supporters say they expect the law to be blocked in court but hope that the appeals process will bring it before the Supreme Court.
They want the court, which now has a conservative majority, to overturn the 1973 ruling legalising abortion.
Alabama’s 35-seat Senate is dominated by men, and none of its four female senators backed the ban. It was then signed by Alabama’s Republican governor, Kay Ivey.
How US abortion debate got to this point
What’s behind Georgia’s anti-abortion ‘heartbeat bill’?
‘Sex strike’ urged in abortion law protest
Sixteen other states are seeking to impose new restrictions on abortion.
Earlier this year the Supreme Court blocked implementation of new abortion restrictions in Louisiana. However the ruling was made by a narrow margin and the case is due to be reviewed later this year.