Lawmakers in the Republic of Ireland have voted to legalise abortion under certain conditions for the first time.
The move, approved by a 127-31 vote in the lower house (Dáil), would authorise a termination when doctors deem that a woman is at risk of taking her life. It needs upper house endorsement, too.
The vote follows the case of an Indian woman who died in hospital after she was refused an abortion.
The debate revealed deep splits in the predominantly Catholic country.
Opponents say the bill could lead to more widespread abortion.
Anti-abortion campaigners say that the bill will allow the intentional killing of the unborn for the first time in the Republic of Ireland.
For them, it is not just a religious but a human rights issue as they believe that in any pregnancy the mother and foetus have equal rights to life.
Others argue the bill is too limited as it does not allow for terminations in cases of rape or incest, or when there is a foetal abnormality.
Nor does it allow for termination when the foetus cannot survive outside the womb.
Members of parliament (TDs) backed the proposal shortly after midnight, after two hotly debated sessions.
Those who support access to abortion say the bill ignores the fact that, on average, 11 women leave the country every day for an abortion in Britain.
Since a Supreme Court ruling in 1992, known as the X case, abortion has been constitutionally available when a woman's life, as distinct from her health, is at risk from the continued pregnancy.
X was a suicidal 14-year-old schoolgirl who had been raped by a neighbour and was initially prevented from leaving the country for an abortion in Britain.
Since then, the credible threat of suicide is, constitutionally, regarded as grounds for a termination.
But in the intervening years, until now, no government has introduced legislation to give doctors legal certainty on when an abortion can be carried out.
And that uncertainty provided part of the context for the Savita Halappanavar case.
She was a 31-year-old Indian dentist who was admitted to hospital in Galway in October 2012 while miscarrying.
She died a week later from septicaemia.
Her request for an abortion was turned down.
Her inquest heard that she could not get a termination at the time because her life was not in danger but, by the time her life was at risk, an abortion would have been too late to save her.
The Fine Gael-Labour coalition government says its proposed legislation will bring the law and constitution into line.
There have been consequences for TDs who did not support the changes proposed.
Fine Gael Junior Minister of State for European Affairs, Lucinda Creighton, voted against the government on the amendment. As a result, she was automatically expelled from the party.
She said she felt "deeply and strongly" that aspects of the bill were based on "flawed logic and absolutely zero medical evidence".
Last week, four other Fine Gael TDs, were removed from the party after they voted against the bill's first reading in the Dáil.
Sinn Féin TD Peadar Toibín also chose to vote against the amendment, which was supported by his party.
In a statement, Sinn Féin said all of its TDs had been "mandated" to vote for the legislation.
"The decision this evening by Peadar Toibín TD to vote against the Sinn Féin position is a serious breach of party rules," said Sinn Féin's party whip in the Dáil, Aengus Ó Snodaigh.
"As a consequence Peadar Toibín has been suspended from Sinn Féin for six months with immediate effect."