Portugal's parliament has voted to legalise abortion on demand, after a referendum failed to settle the issue in the mainly Catholic country.
The Yes campaign was opposed by the Catholic Church
The bill allows the procedure until the 10th week of pregnancy.
Last month 60% of voters backed the measure in a referendum, but the result was voided because of a low turnout.
To become law, the bill must be signed by President Cavaco Silva. Currently abortions are allowed only in cases of rape or of a health risk to the mother.
The legalisation of abortion was supported in parliament by the ruling Socialists, the Communists, the Left Bloc and the Greens. It was opposed by the centre-right Social Democrats and the conservative Popular Party.
Portugal will join a majority of European Union states where abortion is legal. It is banned only in Ireland, Malta and Poland.