Colombia became the fourth South American country to allow same-sex marriage when the constitutional court definitively legalized it.
The Catholic country follows Argentina, Brazil and Uruguay in formally recognizing the rights of same-sex couples to marry.
"The judges affirmed by a majority that marriage between people of the same sex does not violate constitutional order," presiding Judge Maria Victoria Calle told the court.
"The current definition of the institution of marriage in civil law applies to them in the same way as it does for couples of the same sex."
Although previous rulings allowed gay couples to formalize their unions before notaries and judges, same-sex marriage had remained a legal gray area and appeals had been launched against it.
Many officials had refused to register such marriages since congress failed to pass legislation enshrining equal marriage rights in law, prompting protests from gay-rights campaigners.
On April 7, the constitutional court dismissed a petition against equal marriage rights for heterosexual and homosexual couples.
That paved the way for Thursday\’s ruling, which definitively establishes that the constitution guarantees such equality, giving gay couples the legal right to marry.
The decision is set to be recorded as an irrevocable constitutional ruling within a month, making it legally valid.
Six of the court\’s nine judges approved the ruling that "all people are free to choose independently to start a family in keeping with their sexual orientation… receiving equal treatment under the constitution and the law."
State judges, notaries and clerks "must ensure that citizens\’ fundamental rights are observed and that they are all granted equal treatment," the court ruled.
Some 70 unions previously registered only as civil partnerships will now be automatically converted into full marriages under the new ruling, the judge who presented the motion, Alberto Rojas, told reporters.
Same-sex marriage supporters applauded the decision.
"Today we can say with certainty that the Colombian courts have approved equal marriage rights," Marcela Sanchez, leader of the campaign group Colombia Diversa, told AFP.
"We are very happy because Colombia has taken a step toward diversity," said Adriana Gonzalez, who had campaigned for the right to marry her female partner.
"These have been difficult years of uncertainty and frustration, but at last we are going to have the honeymoon we have longed for."
The constitutional court had already ruled last year that same-sex couples may adopt children even when neither member is the biological parent.
Argentina became the first Latin American country to legalize same-sex marriage in July 2010 with a vote in parliament.
Lawmakers in Uruguay followed in 2013.
Brazil authorized same-sex marriage under a court ruling the same year.
In Mexico, gay marriage is legal in the capital and a handful of states. The Supreme Court there has also offered its de facto backing by making it unconstitutional for Mexican states to ban same-sex marriage.
Same-sex marriages are also legal in various other countries elsewhere, including Britain, Canada, South Africa and the United States.
Australia\’s attorney-general said last month that the government would hold a plebiscite on legalizing same-sex marriage this year if re-elected.