Uruguay's senate has voted to legalise first-trimester abortions for all women in a groundbreaking measure that has left those backing the move and those against it unsatisfied.
Jose Mujica, the president, was expected to quickly sign the measure into law on Thursday after senators voted 17-14 to back the legislation, which has already passed the lower house.
The legislation establishes that the public health care system must guarantee every woman the freedom to decide without pressure whether or not to have an abortion.
The measure is a big step for Latin America, where only Cuba grants all women the right to abortions. But it comes with so many conditions that both sides wonder how Uruguay will make it work.
Among other things, a clear declaration that "every adult woman has the right to decide whether to end her pregnancy during the first 12 weeks of gestation" was dropped in order to get enough votes for passage.
In its place, legislators agreed to 10 pages of fine print intended to bring about the same results.
"It's not the best law,and not the solution we wanted, but it's an advance," said senator Luis Gallo, a supporter and member of the ruling Broad Front coalition.
Women who decide to get abortions can now avoid the "humiliating secrecy" of illegal abortions, he argued.
All the ruling Broad Front coalition's senators voted in favour, joined by one member of the opposition, Jorge Saravia of the centre-right National Party.
The immediate reaction to the vote was muted since the result had been expected.
A small group of abortion right activists hailed the passage of the legislation after Danilo Astori, the senate's president, declared it had been passed.
There were no street protests, just a blast of fresh anti-abortion graffiti painted overnight on the sidewalks outside parliament.
"It's a huge step," ruling coalition senator Rafael Michelini said, adding that women will now no longer have to ask the state for permission. "The woman who decides to have an abortion does it."
There are no firm estimates for how many women have obtained abortions illegally in Uruguay. Thousands were ending up in hospitals with complications each year until the government made morning-after pills widely available.
Ruling party politicians said reducing dangers from illegal abortions was their primary motivation.
Opponents vowed to overturn the measure, either through a popular referendum or by defeating the Broad Front government in the next presidential elections.
"This project is an attack on life and that's why we have voted against it. If we win power in the 2014 elections, we'll seek to overturn it," National Party senator Jorge Larranaga said after the vote.
Recent polls have suggested that a majority of Uruguay's 3.3 million people favour decriminalising abortion, as this law accomplishes.
Uruguay's measure decriminalises abortions for women who follow the new rules, but also explicitly says that women who break the rules will not face jail time.
However, anyone who helps women obtain abortions outside the margins of the new law would face up to two years in jail.