The change was prompted by the death last year of an Indian woman who had been refused an abortion in an Irish hospital, but more broadly ends years of uncertainty over the legal status of terminations in the country.
Legislators voted through the bill by 127 to 31 against in the early hours after two days of marathon debate in parliament. It will now go to a vote in the upper house, where the government has a majority.
But in a sign of the rifts that remain on the issue, a junior minister quit her post after voting against the bill and faces exclusion from Prime Minister Enda Kenny's Fine Gael party.
Kenny revealed recently he had received abusive letters written in blood and opponents of the bill have branded him a murderer, while 35,000 abortion opponents marched in Dublin on Saturday.
"I am deeply disappointed to have to vote against the government's abortion bill today," said Lucinda Creighton, junior minister with responsibility for European affairs in Kenny's cabinet.
The Protection of Life During Pregnancy Bill allows for abortion in circumstances where doctors certify there is a real and substantial risk to the life of the mother, as opposed to a risk to her health.
It also permits a termination when one obstetrician and two psychiatrists unanimously agree that an expectant mother is a suicide risk.
The "suicide clause" in particular has divided society, with some anti-termination lawmakers warning that it will lead to a more liberal abortion regime in Ireland.
The bill follows a 2010 European Court of Human Rights ruling that found Ireland failed to implement properly the constitutional right to abortion where a woman's life is at risk.
Under a 1992 Supreme Court ruling, women in Ireland are legally entitled to an abortion if it is needed to save a mother's life - but six successive governments have failed to introduce legislation to reflect this.
The global attention following the death of 31-year-old Indian woman Savita Halappanavar in a Galway hospital in October prompted Kenny's government to act.
Halappanavar had sought a termination when told she was miscarrying, but the request was refused as her life was not at risk at the time. She died of blood poisoning days after miscarrying.
Human Rights Watch (HRW), the US-based rights group, said the new Irish legislation still "fails" women.
"The new law leaves intact the broad criminal ban on abortion. A woman pregnant as a result of rape, for example, or whose pregnancy is not viable, still can't get a legal abortion in Ireland," HRW said in a statement.
Irish pro-choice groups agreed that the new law does not go far enough.
"Overall the legislation is not going to safeguard women's lives and women's rights," Sarah McCarthy of Galway Pro-Choice told AFP.
She doubted that the legislation could have saved Halappanavar.
"It doesn't provide for terminations in cases of an inevitable miscarriage and that's absolutely shameful," McCarthy said.
Kenny did not allow a free vote on the bill. Creighton has been expelled from the party, along with four other government lawmakers who voted against it at an earlier stage.
Creighton said she had voted against the government because of her misgivings about the suicide clause.
"I feel deeply and strongly that aspects of this bill are based on flawed logic and absolutely zero medical evidence," she said.
If passed in the upper house, the bill will go to the president, Michael D. Higgins, who can sign it into law or refer it to the Supreme Court if he feels it is unconstitutional.
New figures from the health ministry in Britain released on Thursday show 3,982 women, including 124 under the age of 18, travelled from Ireland to England or Wales for a termination in 2012.
Between 1980 and 2012, more than 150,000 women travelled from Ireland to England and Wales for a termination, according to the figures.
Predominantly Catholic Malta is now the only country in Europe to maintain a total ban on abortion.
Cyprus and Poland have strict laws which only allow termination when there is a danger to the mother or baby, and in cases where the pregnancy resulted from rape or incest.