BUENOS AIRES, Argentina – Argentina became the first Latin American nation to legalize gay marriage Thursday, granting same-sex couples all the legal rights, responsibilities and protections that marriage brings to heterosexuals.

The law’s passage — a priority for President Cristina Fernandez’s government — has inspired activists to push for similar laws in other countries, and a wave of gay weddings is expected in Buenos Aires. Some gay business leaders are predicting an economic ripple effect from an increase in tourism among gays and lesbians who will see Argentina as an even more attractive destination.

But it also carries political risks for Fernandez and her husband, former President Nestor Kirchner. The vote divided their governing coalition, and while gay rights have strong support in the capital, anti-gay feelings still run strong in much of Argentine society, where the vast majority of people are Roman Catholic.

“From today onward, Argentina is a more just and democratic country,” said Maria Rachid, president of the Argentine Lesbian, Gay, Bisexual and Transgender federation. The law “not only recognizes the rights of our families, but also the possibility of having access to health care, to leave a pension, to leave our assets to the people with whom we have shared many years of life, including our children,” she said.

The 33-27 Senate vote was tallied after a marathon debate that touched on religion, ethics, the legacy of Argentina’s dictatorship and the challenges of raising children. There were three abstentions. Since the lower house already approved it, the law takes effect within days.

Gays and lesbians who have already found Buenos Aires to be a welcoming place to live will likely rush to the altar, but same-sex couples from other countries will need to live in Argentina before becoming eligible, and the necessary residency documents can take months to obtain.

The approval came despite a concerted campaign by the Roman Catholic Church and evangelical groups, which drew 60,000 people to march on Congress and urged parents in churches and schools to work against passage.