Ecuador's highest court, the Constitutional Court, on Wednesday instructed lawmakers to approve legislation allowing gay and lesbian couples to marry.

The 5-4 ruling comes after a lengthy legal battle waged by several couples who wish to marry.

Ecuador has recognized gay couples with civil unions for a decade. But plaintiffs Efrain Soria and Xavier Benalcazar, who have been in a civil union since 2012, argued that they have fewer rights than married couples.

The couple told the AP that they would begin planning a wedding immediately. Soria called the ruling “a joy for our entire community and Ecuador.”

Gay couples can marry in only a handful of Latin American nations, including Argentina, Brazil, Costa Rica, Colombia, and Uruguay. Such unions are allowed in several Mexican states and all states must recognize those marriages.