(CNN)Ecuador's highest court has ruled to recognize same-sex marriage, marking a watershed moment for LGBTQ rights in the Catholic-majority country.
Judges on Quito's constitutional court ruled five-to-four on Wednesday to overhaul the country's laws, arguing that its current marriage legislation was discriminatory and unconstitutional, and that same-sex couples should be allowed equal rights.
The four dissenting judges said that changes to the Ecuadorean constitution should be decided and approved by the government and not the court.
Ecuador's National Assembly will still be required to officially change the laws that define the institution of marriage. Constitutional lawyer Salim Zaidán told CNN, however, that Wednesday's verdict was binding and that same-sex couples would be able to marry as soon as the constitutional court notifies local government offices of their decision. The court has 10 days to do so.
The National Assembly will then introduce -- and pass -- a bill that will modify the country's current marriage law from its current definition as a union between a man and a woman only.
'The right side of history'
The case was brought to the constitutional court by two same-sex couples who had petitioned for the right to marry.
On Wednesday, LGBTQ activists and supporters outside the courthouse hailed the celebration as a victory for a movement that has long campaigned for equal marriage rights.
Same-sex marriage advocate Pamela Troya, who had been denied a license to marry her partner, Gaby Correa in 2013, told CNN she was "overwhelmed with emotion," after a six-year fight.
"The judges decided to be on the right side of history," she said, adding that now the pair will finally be able to get married.
Human rights activist Cristhian Paula told CNN that the decision "recognizes a historic fight for equality in which every citizen has the same rights, with the same name" and that "an institution like marriage is no longer used as an excuse to segregate and discriminate."
Since 2015, Ecuador has legally recognized same-sex unions, with legislation providing that couples are granted the same rights afforded to married couples, with the exception of adoption.
Ecuador's LGBTQ movements have marked some victories over the years, notably through a 2008 constitutional protection that prohibits discrimination based on sexual orientation.
In 2013, conversion therapy was outlawed in rehabilitation institutions and, in 2015, a change to the labor law made it illegal for employers to discriminate against workers on sexual orientation.
Still, homophobic attitudes continue to prevail in parts of the country and the region.
Only a handful of countries in South America have legalized same-sex marriage, including Argentina, Brazil, Colombia and Uruguay, according to the International Lesbian, Gay, Bisexual, Trans and Intersex Association.