[We heard from more than 1,300 women from over 30 countries about their experiences with abortion.]

Ninety-seven percent of Latin American women live in countries that ban abortion or allow it only in rare instances. Only Uruguay, Cuba, Guyana and Mexico City allow any woman to have an early-term abortion.

“Abortion rights was a priority and it will be deeply discouraging to have come this far and fail,” said Benjamin Gedan, an Argentina expert at the Woodrow Wilson International Center for Scholars. But he said women’s rights advocates already had achieved successes, such as the passage of a law that seeks to have an equal number of male and female lawmakers.

“If we make a list of the things we’ve gained and the things we’ve lost, the list of things we’ve gained is much bigger,” said Edurne Cárdenas, a lawyer at the Center for Legal and Social Studies, a human rights group in Argentina that favors legal abortion. “Sooner or later, this will be law.”

President Mauricio Macri of Argentina opposed the bill, but said he would have signed it. After the vote, administration officials said they planned to ease abortion penalties in an overhaul of the penal code that will be presented Aug. 21. Women getting abortions can be charged with a crime and imprisoned under the current law, although that happens very rarely.

The penal code changes had been in the works for some time, but they appeared to reflect Mr. Macri’s realization that the reproductive-rights movement in Argentina was now an established force.

“The women’s movement mobilized all regions of Argentina; it was intergenerational and exceeded everybody’s expectations,” said Françoise Girard, the president of the International Women’s Health Coalition, which supports legal abortion. “The new generation of teenage girls who came out in such numbers will not be stopped.”