An anticorruption crusader won a runoff election for Guatemala’s presidency on Sunday, handing a stunning rebuke to the conservative political establishment in Central America’s most populous nation.

Bernardo Arévalo, a polyglot sociologist from an upstart party made up largely of urban professionals, took 58 percent of the vote with 98 percent of votes counted on Sunday, the electoral authority said. His opponent, Sandra Torres, a former first lady, got 37 percent.

Alejandro Giammattei, the current president, who is prohibited by law from seeking re-election, congratulated Mr. Arévalo and extended an invitation to organize an “orderly” transition of power.

Full official results are expected within the coming days.

Mr. Arévalo’s win is a watershed moment in Guatemala, one of Washington’s longtime allies in the region and a leading source of migration to the United States. Until he squeaked into the runoff with a surprise showing in the first round in June, it was the barring by judicial leaders of several other candidates seen as threats to the country’s ruling elites that had shaped the tumultuous campaign.