Wednesday’s parliamentary vote was the culmination of a referendum last year.
San Marino's parliament has finally voted to legalise abortion following last year's landmark referendum.
The landlocked, Catholic micronation was one of the last European states that criminalised abortions under all circumstances.
But last September, 77% of citizens voted overwhelmingly to overturn the 150-year-old law to make abortion legal in the first 12 weeks of pregnancy after a medical consultation.
The bill was approved by 32 members of San Marino's legislature on Wednesday, with seven against and 10 abstaining from the vote.
Abortion procedures will also be legal after the first 12 weeks if serious foetal anomalies put a woman’s life or health -- physically or psychologically -- at risk. The cost of the procedure will be covered by San Marino’s public health system.
“We are satisfied,″ said Elena D’Amelio, one of the advocates who had collected signatures as part of a petition drive to hold the referendum.
"Before the new law legalising it, women not only had to pay for it, you had to do it in secret."
Previously, women in San Marino had travelled to a hospital in surrounding Italy for an abortion but were liable for criminal prosecution.
D'Amelio also said that the new law provides sex education in schools to prevent unwanted pregnancies, and compensates any woman who now travels to Italy for an abortion if there is a shortage of medical staff in the country.
It is unclear whether some health care workers in San Marino’s only public hospital might object to the law and opt out of providing abortions.
Abortion is still illegal in Malta and Andorra, while Poland introduced a near-total ban on the procedure in 2021.