The 35-seat senate consists of 27 Republicans that are all white men. A total of 25 of them voted to pass the bill, while the remaining two did not vote.
The legislation goes against a 1973 ruling, making abortion a crime except in the case when the fetus is a serious threat to the health of the woman. No allowances were made for rape victims.
Doctors found guilty of carrying out the procedure could serve a maximum sentence of 99 years behind bars.
Bobby Singleton, the Democratic minority leader, pointed out the huge gender imbalance in the Alabama senate, which consists of just four women.
“You’ve got 27 men over on the other side ready to tell women what they can do with their bodies,” he told The Guardian.
During the heated debate, Sky News reports Republican Senator Clyde Chambliss as saying: “When God creates the miracle of life inside a woman’s womb, it is not our place as human beings to extinguish that life.”
The bill now heads to the office of Governor Kay Ivey, another Republican. Should she sign the bill, it will take six months to come into effect.