Currently, abortion is allowed in Argentina in only three cases, similar to most of Latin America: rape, a threat to the mother's life or if the fetus is disabled.
The debate in the Senate went on for more than 16 hours and was reportedly very passionate at times.
The lower house of Congress has already passed the measure and Argentine President Mauricio Macri says he will sign it if approved by the Senate.
The vote came as a major setback to the hundreds of thousands of pro-choice advocates who ran an aggressive campaign against strong opposition from the highly influential Catholic Church in the homeland of Pope Francis.
Speaking to a delegation of the Forum of Family Associations at the Vatican, Francis denounced today's abortion culture and urged his hearers to accept human life as it comes from the hand of God. The Health Ministry estimated in 2016 that the country sees as many as half a million clandestine abortions each year, with dozens of women dying as a result.
Some resort to using a clothes hanger wire or knitting needle to break the amniotic sac inside the womb, others take toxic mixtures or herbs that can prove fatal. Others drink herbs, insert dubious non-abortive pills in the vagina, or pump toxic mixtures, which can cause ulcers, hemorrhage and ultimately severe infections, and death. Feminist groups, in turn, have held protests, often wearing green that symbolizes their movement or outfits based on author Margaret Atwood's "The Handmaid's Tale".
An abortion-rights activist reacts outside the National Congress in Buenos Aires, on Thursday to news that the Senate voted to reject a bill that would have legalized abortion.
Jose Miguel Vivanco, director for the Americas at Human Rights Watch, said Argentina had a "historic opportunity" to protect the rights of women. Amnesty International has told Argentine legislators that "the world is watching".
Catholic and evangelical groups protested abortion with the slogan, "Argentina, filicide (child murder) will be your ruin".
With 31 votes in favour, 38 votes against and two abstentions the voluntary termination of pregnancy bill is rejected. There are three exceptions: if a woman is raped, pregnancy puts her life in danger, or a fetus is brain-dead. Only in the Central American trio of El Salvador, Honduras and Nicaragua does it remain totally banned.
"We do as the Nazis did to safeguard the purity of the race, but we do it with 'white gloves, '" he said.