“There is no question that the law is unusual for a country that is not as secular as Western European democracies,” said Javier Corrales, a political science professor at Amherst College. “There’s a clear conflict with the church. Very seldom do we see presidents willing to fight the church so strongly on this particular issue in Latin America,” even in countries led by left-leaning governments.

Argentina’s new law will give gay people the same marital rights as heterosexuals, including adoption and inheritance rights, and reflects the broadening legal recognition of same-sex relationships across Latin America.

Last year, Mexico City became the first jurisdiction in the region to legalize gay marriages. The conservative federal government has challenged that move in the Supreme Court, but weddings have continued and the city has married more than 270 couples.

Three other countries in the region — Uruguay, Colombia and Ecuador — have recognized civil unions for same-sex couples in recent years, as have various cities and states.

But the trend is not universal. Honduras barred gay couples from marrying or adopting children in 2005, and refused to recognize same-sex marriages from other countries. The anti-gay atmosphere in Honduras is so intense, human rights groups say, that more than 20 gay and transgender people have been killed there in the past five years.

Newsletter Sign Up Continue reading the main story Please verify you're not a robot by clicking the box. Invalid email address. Please re-enter. You must select a newsletter to subscribe to. Sign Up You will receive emails containing news content , updates and promotions from The New York Times. You may opt-out at any time. You agree to receive occasional updates and special offers for The New York Times's products and services. Thank you for subscribing. An error has occurred. Please try again later. View all New York Times newsletters.

“This inspires us to fight even more,” Óscar Amador, a spokesman for Violet Collective, a gay rights group in Honduras, said of Argentina’s law. “Maybe one day, we’ll have the same.”

In Guatemala, President Álvaro Colom said of gay marriage during his 2007 campaign that “God said ‘Adan and Eva,’ not ‘Adan and Esteban.’ ”

Once elected, though, Mr. Colom agreed to support civil unions and invited gay leaders to the National Palace. “Esteban,” the president said, according to news reports, “I ask you in the name of the Guatemalan state and in my own name to pardon us for centuries of mistreatment and discrimination.”

Advertisement Continue reading the main story

Argentina had a history of granting labor rights in the 20th century, and Mrs. Kirchner and her husband, former President Néstor Kirchner, have sought to satisfy the demand for human rights that has followed the country’s return to democracy in 1983. Under the Kirchners, the government has marginalized the military and now the Catholic Church, both of which once held greater political sway here.

The government “committed treason against public opinion by not holding a plebiscite on the issue,” said Eduardo Bieule, president of the Corporation of Catholic Lawyers in Buenos Aires, noting that tens of thousands of people demonstrated against the law. “I don’t want to think about the legal problems this is going to bring.”

Some political observers saw the Kirchners’ strident support of same-sex marriage as opportunistic. Mr. Kirchner, now a congressman, hopes to run for president again next year, and the issue gives him a chance to appear more liberal, especially in Buenos Aires, a city where he has lost support and that has become a destination for gay tourism.

“This helps the Kirchners politically,” said Michael Shifter, the president of the Inter-American Dialogue in Washington. “But to reduce it to political calculation is not entirely fair. This reflects the socially liberal culture in Argentina today.”

The Senate debate stretched into the early morning on Thursday, touching on homosexuality, religion, the composition of families and discrimination. Those against the law said the “rules of nature” needed to be preserved, while others spoke passionately about how times were changing.

“The vote came despite a lot of pressure” from the Catholic Church, said Fortunato Mallimaci, a sociologist at the University of Buenos Aires. “In the past, this would have influenced the votes of the senators. But not now.”