Fabricio Alvarado (Photo by EZEQUIEL BECERRA/AFP/Getty Images)

A Presidential candidate who vowed to stop equal marriage has topped the ballot in the first round of Costa Rica’s Presidential election.

The Central American country’s Presidential battle has been largely defined by a battle over same-sex marriage, with fringe evangelical Fabricio Alvarado Muñoz receiving a surge in support after running an aggressive anti-gay marriage campaign.

He topped the ballot during Sunday’s Presidential election, taking 24.8 percent of the vote, ahead of the ruling Citizen Action Party’s candidate Carlos Alvarado Quesada on 21.7 percent, with most of the votes counted.

As no candidate reached the 40 percent mark in the election, it will now head to a run-off vote between the two men, which may largely be seen as a referendum on same-sex marriage.

Alvarado Muñoz has vowed to withdraw Costa Rica from a human rights treaty that could require it to provide recognition to same-sex couples.

Earlier this month, the Inter-American Court of Human Rights ruled against the country’s law that prevents same-sex couples from marrying.

The court had found Costa Rica is in violation of its treaty obligations under the American Convention on Human Rights (ACHR) by not providing marriage equality.

The human rights court has jurisdiction over 16 countries, and six of them – Argentina, Brazil, Chile, Colombia, Mexico and Uruguay – signed a statement welcoming the news.

However, the issue has been extremely divisive in Costa Rica, with religious leaders calling on their congregations to rise up and help stop same-sex marriage.

Munoz, originally a long-shot candidate in the race, shot up in the polls after he vowed to withdraw from the ACHR and ban same-sex marriage.

Following the vote this weekend, he declared the results a victory for the “traditional family”.

The candidate said: “We propose the sovereignty of the family as the fundamental basis of society.”

“Costa Rica has sent a message to traditional parties – never again will they meddle with the family.”

Meanwhile, his rival Carlos Alvarado Quesada had stood firm over his commitment to human rights laws.

He said: “The Costa Rica of the 21st century requires a government that knows how to move forward with vigor, love, happiness (and) the agenda of equality.”

But he will face pressure to change his stance ahead of the run-off vote.

The US recently refused to take part in a statement praising the equal marriage court ruling.

All of the members of the Organization of American States (OAS) LGBTI Core Group signed on to a statement supporting the court’s opinion – but the United States declined to do so.

The seven nations that signed the statement are Argentina, Brazil, Canada, Chile, Colombia, Mexico and Uruguay.

The United States was the only member of the OAS LGBTI Core Group not to sign the statement welcoming the news.

Chile, which does not yet have marriage equality, signed the statement – but the Trump administration refused to do so.

The statement says: “Argentina, Brazil, Canada, Chile, Colombia, Mexico and Uruguay, as members of the OAS LGBTI Core Group, welcome the Advisory Opinion of the Inter-American Court of Human Rights reiterating that sexual orientation and gender identity are protected categories under the American Convention on Human Rights and affirming that States have the responsibility to recognize, guarantee and protect the rights that derive from a family bond between persons of the same sex.

“The Court’s Opinion constitutes a valuable contribution to the jurisprudence of the Inter-American Human Rights System, as it reminds States of their obligations regarding guaranteeing and protecting the rights of LGBTI persons across the region.

“Furthermore, the Court understood that a person’s full autonomy to establish a permanent and marital bond is derived from the principle of human dignity, and that such a bond deserves equal rights and protection regardless of the sexual orientation of the parties.

“Likewise, the Advisory Opinion reaffirms the rights of transgender people by affirming that the change of name, image adjustment, as well as the rectification of sex or gender references, in registers and in identity documents so that these are consistent with self-perceived gender identity, is a right protected by the American Convention. As a consequence, States are obliged to recognize, regulate and establish the appropriate procedures for such purposes.

“Without prejudice to the sovereign right of all States to adopt policies and legislation in a progressive manner and to evolve on this matter at their own pace, we agree with the Court’s view that lack of consensus on respecting the rights of certain groups that are characterized by their sexual orientation or their gender identity or expression cannot be considered a reason to deny or restrict their human rights or perpetuate historical or structural discrimination against them.

“The afore-mentioned members of the Core Group are optimistic that this Advisory Opinion will provide elements for States to drive legislative, administrative and public policy reforms through which progress is made in the protection and guarantee, under equal conditions, of the rights of LGBTI people.”