Uruguay is set to become the second nation in South America to legalize abortion after the country's senate passed the controversial bill on Thursday.

The vote came after Uruguay's lower house, the Chamber of Deputies, voted to pass the law, legalizing abortion by just one vote, 50-49. There were several local reports of lawmakers forgoing the vote, citing conflicting interests between their faith and conscience. The votes were still cast, but were done by replacements.

Uruguayan President Jose Mujica declared that he would uphold the law if the country's Senate approved the newly passed measure.

Under the new law, women would be granted the right to obtain a legal abortion anytime during the first 12 weeks of pregnancy. First, however, they must consult with a panel of three medical professionals who would advise the patient of the risks of abortions and introduce other alternatives available, such as adoption and social welfare programs.

The law would also permit abortion in the event of rape or incest up to the first 14 weeks of pregnancy. The law would decriminalize late-term abortions should the mother's life be at risk, or if the fetus is determined to be too deformed to survive after birth.

"This is a sad day for Uruguay and for Latin America, which for the most part has stood strong against pressure from powerful Western governments to cut their birth rates to a level with which wealthy elites will be more comfortable," Shenan J. Boquet, Human Life International President, said in a statement.

"The 'bright spot' on this dark day appears to be that there will be required counseling on options other than abortion … these measures allow women to make more thoughtful and life-affirming choices for their children and themselves," he added.

Pablo Abdala, a member of the National Party opposed to the new law, has come out and publicly denounced the law, calling it a violation of human rights. He has also promised to promote a popular referendum to overturn the law should President Mijica allow the bill to become law.