Cuba is set to become the latest country in Latin America to approve gay marriage, after the National Assembly on Sunday signed off on a new constitution that defines marriage as “the consensual union of two people, regardless of gender”.

The new constitution, known as the Magna Carta – which also recognises private property for the first time since the Cold War – will be put to a referendum later this year.

The news was met with elation by the LGBTQ community, many of whom were hopeful but not certain the measure would pass.

“This is marvellous,” said Pablo Navarro, 70, who spent two years cutting sugar cane in a correctional labour camp in the 1960s because of his sexuality. “I feel proud that the new generation can enjoy this achievement even though we couldn’t.”

“It’s a really important step forward,” said Yeandro Tamayo, 40, a gay theatre director from Havana, who watched the National Assembly debate the issue live on television. “I’ve never been interested in marriage, now they they have approved it, I might get married myself!”

Legislators voted unanimously for the new constitution, replacing the current constitution’s definition of marriage as the “voluntary union between a man and woman”. The new constitution does not explicitly address the question of whether gay couples can adopt children, although experts say this will now likely be possible.

Prior to the vote, popular campaigns both in favour of and against same-sex marriage led to rare, open political debate on the Communist-ruled island.

Five of Cuba’s evangelical denominations published an open letter in June declaring that “marriage is exclusively the union of man and woman” and that “the ideology of gender has no relation with our culture, our struggles, or with the historic leaders of the Revolution”.

Posters appeared in Havana featuring a husband and wife with two children that read: “I am in favour of original design – the family as God created it.”

A poster opposing gay marriage is wrapped around a pole in Havana. Photograph: STRINGER/Reuters

The pro-gay marriage campaign was led by Mariela Castro, the director of the National Centre for for Sex Education (CENESEX), a lawmaker, and daughter of former President Raúl Castro. CENESEX organised the “Conga against Homophobia and Transphobia” in March, in which thousands of revellers danced among gay pride flags and Fidel Castro banners.

This “officialista” campaign was accompanied by a small group of around 100 LGBT activists who lobbied on social media, ran queer cinema screenings, and staged public performance art.

“CENESEX has been educating and lobbying on this issue since 2007 and has been the main force here, but all of our actions have played a role,” said feminist militant Marta María Ramirez, 42, through joyous tears. “The National Assembly is now responding to specific demands of the people and not only to their own experiences as bureaucrats.”

Cuba’s about-face on gay rights has been in train for decades.Employment discrimination because of sexual orientation is illegal in both the state and private sector. Legislation enacted earlier this year allows for steep fines and even the suspension of licenses for private employers who discriminate because of gender, race or sexuality.

Sex-change operations were legalised in 2008 and are carried out at no cost to the patient. Cuban surgeons performed dozens last year.

Elsewhere in Latin America and the Caribbean, same-sex marriage is legal in Argentina, Uruguay, Brazil, and Colombia. But homosexuality remains a criminal offence in seven Caribbean island nations.