SAN JOSE (Reuters) - Costa Rica’s President-elect Carlos Alvarado Quesada ran up a bigger-than-expected margin of victory in Sunday’s runoff election, leading a progressive coalition to beat back a stiff run from a Christian conservative singer.

Carlos Alvarado Quesada, presidential candidate of the ruling Citizens' Action Party (PAC), gestures to supporters after casting his ballot during the presidential election in San Jose, Costa Rica April 1, 2018. REUTERS/Jose Cabezas TPX IMAGES OF THE DAY

The 38-year-old former minister in the outgoing government is now set to join French President Emmanuel Macron and New Zealand Prime Minister Jacinda Ardern as democratically elected heads of state before turning 40.

Like them, Alvarado Munoz ran unabashedly on a center-left platform.

He has faced much stronger headwinds by backing gay marriage in the conservative Central American country. In the closing days of the campaign, a poll showed seven in 10 Costa Ricans were opposed to such unions.

His decisive 20-point margin of victory offers hope to fellow progressives elsewhere in Latin America working to defeat an evangelical-led backlash that has grown alongside expanding acceptance of gay and lesbian rights.

It also gives hope to his supporters that he can unite the country that decades ago gave up a standing army and is known worldwide for its ecological stewardship.

Alvarado Quesada, who earned his masters in Britain and worked for three years for Procter & Gamble in Panama, told Reuters in a recent interview he saw a larger trend in the divide exposed after a January court ruling called on Costa Rica to legalize same-sex marriage.

“I think it’s a reflection of what’s happening in the region and the world,” he said. “People are experimenting across the world with movements that push single-issue or populist agendas.”

Alvarado Quesada said he decided to step up after seeing what happened in the United Kingdom with the Brexit vote, what happened in Colombia after the referendum on peace, and seeing Western democracies face populist or fundamentalist movements.

Before deciding to run for president, Alvarado Quesada served as social development minister and then labor minister under Luis Guillermo Solis, whose center-left party he worked in his 20s.

As a younger man, he also sang in a college rock band called Dramatika.

Following college, his first job was at a sports gambling call center, where he took bets on mostly U.S. teams in order to make enough money to buy his first guitar.

Costa Rica’s future president later turned to fiction writing, publishing four books over the course of a decade, including his novel “The life of Cornelius Brown.”

The married father of one will now face the difficult task of forging consensus in a country where large swaths of people have been polarized by faith-based appeals, a development many voters described as unprecedented.

But his supporters point to his reserved nature as a strength, arguing his instinct toward negotiation will serve the country well after a hard-fought campaign.

Alvarado Quesada will take office on May 8.