By Alison Roberts
BBC News, Lisbon
Portugal's government has pledged to legalise abortion in the first 10 weeks of pregnancy, after a clear majority in a referendum voted for that proposal.
Fewer northerners voted for legalisation than southerners
Fewer than half the electorate voted, meaning the result is not legally binding.
But the pro-reform governing Socialists, who have a majority in parliament, had made clear beforehand that they would act on the result.
"Finally women will be treated with the respect and dignity they deserve," said Maria Jose Alves, a medical doctor and leading figure in the campaign for reform.
"This paves the way for a more just, more humane Portugal," she told supporters at a rally in Lisbon after the result.
Among voters in Sunday's referendum, 59% backed reform.
That contrasts with an earlier vote on the subject, in 1998, when 51% rejected reform, on a turnout of less than one-third.
In both cases, some voters are thought to have stayed at home after the Catholic Church appealed for people who did not feel able to vote "No" to abstain.
"The law we want to approve should from the outset respect the referendum result," Prime Minister Jose Socrates said after the final figures were announced.
"The termination of a pregnancy in the first 10 weeks, carried out at the woman's request, in a legally authorised health institution, will no longer be a crime."
Work on the law would start immediately, he added.
And with abortion legal in all but three other European countries, Portugal can draw on experience elsewhere in dealing with this sensitive issue.
Setback for Church
Church leaders expressed dismay at the referendum result.
Dom Jorge Ortiga, Archbishop of Braga and President of the Portuguese Episcopal Conference, said the Church did not see the result as decisive, because it never saw the question of life as a matter for a referendum.
"I want to stress what Portugal's bishops have always said: life is an inviolable gift, a fundamental right of all human beings and the source of all other rights," he wrote in a pastoral note.
The archbishop's diocese is in the Catholic heartland of northern Portugal, where a majority of voters rejected reform.
In Lisbon and the south there were large majorities in favour.
Luis Marques Mendes, leader of the main opposition group in parliament, the centre-right Social Democratic Party (PSD), has said the result should be accepted despite its non-binding nature.
The task now was to reach a consensus on its implementation, he said.
"The will of the Portuguese must be respected. It's important to include in the final version of the new law a compulsory period of counselling for the woman who is thinking of having an abortion."
As a political protege of President Anibal Cavaco Silva, who could block a new law, Mr Marques Mendes's comments may be an indication that the president will not veto what he sees as balanced legislation.
Prime Minister Socrates: "The people spoke with a clear voice"
Prime Minister Socrates has already signalled his intention to seek consensus.
The law tabled by the government would, he said, provide for "a period of reflection" for a woman considering having an abortion.
The legalisation of abortion cuts the ground from under Portugal's well-established illegal practitioners.
It will also take away business from Spanish clinics that today serve thousands of Portuguese women a year.
In anticipation of the change, one leading clinic based in the Spanish town of Badajoz, last year announced plans to set up shop in Lisbon.
It has already bought premises downtown.
The fact that abortion is a business was one of the arguments used by the "No" campaign against reform.
In fact, it has been one for years - but in secret, with private clinics in Portugal that carry out the operation simply not paying tax.
Poorer women often resort to backstreet abortions, often in dangerously unsanitary conditions, with the result that many end up in hospital with infections or serious complications from which they may die.
Meanwhile, "No" campaigners, who had cited a falling birth rate as one of the reasons to block reform, have called for more generous maternity benefits to encourage women to go through with their pregnancies.