QUITO, Ecuador — Ecuador's highest court authorized same-sex marriage Wednesday in a landmark case seeking to expand LGBT rights in the small South American nation.

Gay rights activists holds signs that read "Equal marriage" and "Love and let love" outside of the Constitutional Court, waiting for the court's decision on gay marriage, in Quito, Ecuador on June 4, 2019. Dolores Ochoa / AP

The decision by the Constitutional Court came after a lengthy legal battle waged by several couples and gay rights advocates.

With the 5-to-4 ruling, Ecuador joins a handful of Latin American nations — Argentina, Brazil, Costa Rica, Colombia and Uruguay — that have legalized same-sex marriage either through judicial rulings, or less frequently, legislative action.

Plaintiff Efraín Soria told The Associated Press that he would immediately begin planning a wedding with his partner, Xavier Benalcázar, whom he met years ago and has been in a civil union since 2012.

Same-sex unions have been legal in Ecuador for a decade but civil partners enjoy fewer rights than married couples when it comes to inheritance and estate laws. In the ruling, the justices instructed congress to pass legislation ensuring equal treatment for all under the country's marriage law.

The ruling is "a joy for our entire community and Ecuador," said Soria, who is also president of the Ecuadorian Equality Foundation, an LGBT rights group.

A decision by the Inter-American Court on Human Rights affirming that countries should allow same-sex couples the right to marry paved the way for the case.

FOLLOW NBC OUT ON TWITTER, FACEBOOK & INSTAGRAM