BUENOS AIRES — Former Senator Luis Lacalle Pou appeared to have carved out a narrow victory in Uruguay’s presidential election on Sunday, the latest sign that unrest simmering across Latin America favors anti-incumbent candidates.
Mr. Lacalle Pou, a center-right veteran lawmaker, had more than 48.8 percent of the vote, with more than 97 percent of precincts counted, preliminary results showed. That put him slightly more than 1 percentage point ahead of his rival, Daniel Martínez.
But late Sunday, election officials still had not called the race because the number of provisional ballots exceeded the margin between the two candidates. Pollsters said exit polls and the preliminary results appeared to give Mr. Lacalle Pou a clear edge.
Mr. Lacalle Pou stopped short of claiming victory when he addressed supporters shortly past midnight, but said his lead was “irreversible.”
Noting how tight the election turned out to be, Mr. Lacalle Pou struck a conciliatory note.
“This reaffirms that this must unite as a society,” he said. “We must unite as Uruguayans.”
If the results are confirmed, Mr. Lacalle Pou’s victory would be the latest setback for leftist politicians in Latin America. They have long regarded prosperous and politically stable Uruguay as an exemplar for its robust social safety net and its comparatively low inequality.
Mr. Martínez celebrated his party’s performance, noting it had exceeded expectations. He did not concede the race, noting that provisional ballots could conceivably alter the outcome.
“Uruguayans are smart people,” he told supporters late Sunday night. “They decide with their head and their heart.”
In the campaign’s final days, polls had indicated that Mr. Lacalle Pou, 46, of the National Party would easily beat Mr. Martínez, 62, of the Broad Front coalition. But Mr. Martínez, a former mayor of Montevideo, the capital, appears to have enjoyed a surge in support during the final stretch.
The Broad Front is a coalition of center-left and leftist parties that has held the presidency since 2005. Mr. Martínez was the front-runner in the first round of voting on Oct. 27, winning 39 percent of the vote.
But Mr. Lacalle Pou gained momentum after that with backing from the main candidates who did not qualify for the runoff. Polls show that voters have lost faith in the governing coalition amid a rise in crime and a slowdown in economic growth.
Still, Broad Front governments have largely avoided the corruption scandals and economic slumps that have bedeviled other leftists in the region.
On their watch, Uruguay’s economy has grown steadily, inequality has shrunk and the nation of 3.4 million people has made international headlines by championing some liberal social initiatives that were largely popular at home.
Uruguay’s Congress legalized abortion in 2012, and the following year it passed a law allowing same-sex marriage. In 2017, Uruguay became the first country to fully legalize the sale of marijuana for recreational use, creating a model for taxing and regulating the sale of drugs that drew wide international interest.
But the Broad Front struggled to persuade voters that continuity was the right course, said Gerardo Caetano, a professor of history and political science at the University of the Republic in Montevideo.
“Uruguay is part of this pattern of angry, unhappy societies that have seen an increase in purchasing power, and due to that increase they began demanding more,” he said. “People are angry and have turned against the government.”
Public safety also weighed heavily on voters, experts said. Last year, killings and violent robberies increased substantially, a dynamic that gave Mr. Lacalle Pou a useful line of attack against the Broad Front.
“The biggest challenge has been public security,” saidJennifer Pribble, an associate professor of political science at the University of Richmond who studies Uruguayan politics. “The Broad Front was slow to respond to citizen concerns, while the opposition used that quite masterfully.”
Sluggish growth also worked against Mr. Martínez. Uruguay’s gross domestic product is expected to increase by 0.4 percent this year, according to the International Monetary Fund.
“Although the economic situation is not a crisis, there are indicators that are concerning, including slow growth, inflation and unemployment,” said Mariana Pomiés, executive director of Cifra, a local pollster. “This change leads the population to consider an alternative that can fix a few things.”
Experts and voters say Mr. Martínez was further stymied by fractures in the Broad Front and that he struggled to excite voters.
“Martínez does not have the profile to be president,” said Mercedes Peirano, 61, who said she had voted for him, albeit unenthusiastically. “He’s a good person but lacks charisma and stumbles when he talks.”
Mr. Lacalle Pou — the son of former President Luis Alberto Lacalle, who governed from 1990 to 1995 — has spent the years since his failed presidential bid in 2014 cobbling together an alliance of opposition factions.
He promised to rein in debt, accusing the Broad Front government of fiscal irresponsibility, argued that the government can do more to help small businesses succeed and vowed to improve security with sweeping reforms of the police.
“Lacalle Pou began to think about the 2019 campaign the day after he lost in 2014,” said Fernanda Boidi, a political consultant in Montevideo and regional coordinator of Vanderbilt University’s Latin American Public Opinion Project. “Lacalle Pou has been preparing very assiduously for this opportunity and carried out a very solid, very unified campaign.”
The cluster of parties that unified behind Mr. Lacalle Pou’s candidacy includes politicians from a broad ideological spectrum. Experts said that may prove challenging as the new president seeks to push changes through Congress, including an overhaul of the pension system.
Among his supporters is a new far-right party, Cabildo Abierto, led by a former military leader, a jarring development for Uruguayans who have bleak memories of despotic military rule in the 1970s and 1980s.
Mr. Lacalle Pou, a lawyer by training, served in the lower house of Congress from 2000 to 2015 and served in the Senate until resigning his seat in August to focus on the political race.
Daniel Politi reported from Buenos Aires, and Ernesto Londoño from Rio de Janeiro.