Uruguay took a step toward legalizing abortion as lawmakers in the lower chamber of parliament narrowly passed a bill allowing the procedure under certain conditions.

The vote was 50-49 and came as proponents and critics of the bill yelled out from the gallery in the chamber.

The bill now goes to the Senate, where it is expected to win passage. It is modeled after abortion laws in Europe.

The legislation would allow a woman to have an abortion in the first 12 weeks of pregnancy.

But she would have to first speak to at least three doctors to be advised of the health risks, alternatives to ending the pregnancy, and about programs for child care and adoption.

Then the woman would have to wait another five days before undergoing the procedure.

Abortion would be allowed up to 14 weeks into the pregnancy if the woman's health is deemed at risk, if the fetus has malformations incompatible with life or if the pregnancy is the result of rape.