SANTIAGO, Chile (AP) -- Chileans were electing their next president Sunday following a polarizing campaign between a free-market firebrand likened to Donald Trump and a millennial former student protest leader who promises to attack nagging inequality in Latin America's most advanced economy.
José Antonio Kast, a lawmaker who has a history of defending Chile's past military dictatorship, finished ahead in the first round of voting last month but failed to secure a majority of votes. That set up a head-to-head runoff against Gabriel Boric, who trailed him by about two percentage points.
Whoever wins will be breaking precedent. Since the return of democracy three decades ago, no candidate leading after the first round has ever been defeated in the runoff. But no president has ever been elected without winning in the capital, Santiago, which Boric carried comfortably in the first round.
Opinion polls in recent days consistently showed an advantage for Boric, although sometimes within the margin or error, meaning the contest is likely to be decided by whichever candidate is able to energize his base while at the same time winning over the majority of voters who don't side with political extremes.
"Turnout will mean everything," said Robert Funk, a political scientist at the University of Chile.
The two candidates couldn't be more polar opposites.
Kast, 55, a devout Roman Catholic and father of nine, emerged from the far right fringe after having won less than 8% of the vote in 2017. He rose steadily in the polls this time with a divisive discourse emphasizing conservative family values and playing on Chileans' fears that a surge in migration -- from Haiti and Venezuela -- is driving crime.
A longtime lawmaker, he has a record of attacking Chile's LGBTQ community and advocating more restrictive abortion laws. He also accused outgoing President Sebastian Pinera, a fellow conservative, of betraying the economic legacy of Gen. Augusto Pinochet, the country's former military leader. Kast's brother, Miguel, was one of Pinochet's top advisers.
Boric, 35, would become Chile's youngest modern president. He was among several activists elected to Congress in 2014 after leading protests for higher quality education. If elected, he said, he will "bury" the neoliberal economic model left by Pinochet and raise taxes on the "super rich" to expand social services, fight inequality and boost protections of the environment.
In recent days, both candidates tried to veer toward the center.
"I'm not an extremist. ... I don't feel far right," Kast proclaimed in the final stretch even as he was dogged by revelations that his German-born father had been a card-carrying member of Adolf Hitler's Nazi party.
Meanwhile Boric, who is backed by a coalition of leftist parties that includes Chile's Communist Party, brought more centrist advisers onto his team and promised that any changes would be gradual and fiscally responsible.
"On both sides, people are voting out of fear," said Funk. "Neither side is particularly enthused with their candidate but they are voting out of fear that, if Kast wins, there will an authoritarian regression or because they fear Boric is too young, inexperienced and aligned with the communists."
Whoever wins is likely to have a slim mandate and will be hemmed in by a divided congress.
In addition, the political rules could soon change because a newly elected convention is rewriting the country's Pinochet-era constitution. The convention -- the nation's most powerful elected institution -- could in theory call for new presidential elections when it concludes its work next year and if the new charter is ratified in a plebiscite.