MEXICO CITY—Andrés Manuel López Obrador, a divisive former Mexico City mayor who vowed to upend Mexico’s corrupt status quo, cruised to the biggest win in nearly four decades in Sunday’s presidential election, moving the country’s politics sharply to the left and dealing a major blow to its established political parties.

Mr. López Obrador got more than 53% of the vote, according to a representative sample of ballots released by Mexico’s election agency. That was more than 30 percentage points more than his closest rival, conservative...