By Enrique Andres Pretel
SAN JOSE (Reuters) - Costa Ricans vote for a new president on Sunday in a race upended in the final weeks by a debate over same-sex marriage, as leading candidates in the crowded field fiercely opposed gay rights that have recently been expanding in Latin America.
Conservative Christian singer and TV personality Fabricio Alvarado skyrocketed to the top of the 13-person field after speaking out against a January ruling by the region's top human rights court calling on Costa Rica to give equal civil marriage rights to gay and lesbian couples.
If no candidate wins at least 40 percent of Sunday's vote, a run-off election with the top two finishers is set for early April.
The 43-year-old Alvarado, a congressman with the National Restoration Party, has called the ruling by the Inter-American Court of Human Rights a violation of the country's sovereignty and an affront to traditional values.
"We have to stand up to those who want to trample on the family," he said at the campaign's final debate, threatening to pull out of the court over its resolution.
Rival Antonio Alvarez, a banana entrepreneur and candidate of the National Liberation Party, has said while he personally opposes the court's decision, he would respect it if he wins.
Among the few candidates who embraced the court's resolution is Carlos Alvarado, a former labour minister in the outgoing government of President Luis Gillermao Solis.
Elsewhere in the region, gay and lesbian couples can marry in Argentina, Brazil, Colombia, Uruguay and in parts of Mexico.
Running a close second in one recent poll, conservative Juan Diego Castor, a former justice minister, is aiming to lure voters with an anti-crime platform as well as pushing for less restrictions on miners and oil companies.
A high-end coffee exporter, Costa Rica is well-known for its environmental stewardship and thriving eco-tourism sector.
Solis, a former diplomat and history professor, won in a landslide four years ago but has seen his popularity slide as an investigation into an influence peddling scandal has unfolded.
He is barred by law from seeking a second term.
Solis gained international attention when he hoisted a rainbow flag along with the Costa Rican flag atop his office just a week after he took office as a statement against homophobia.
Costa Rica's 3.3 million voters are predominantly Roman Catholic and most describe themselves as conservative.
(Reporting by Enrique Andres Pretel; Writing by David Alire Garcia)