MEXICO CITY — As votes were tallied Monday after a historic election, Andrés Manuel López Obrador appeared close to gaining control of Congress as well as the presidency — a resounding mandate for the country’s first leftist leader in decades.
With just over half of the votes counted, López Obrador had about 54 percent, the most in the history of Mexico’s multiparty democracy, the Associated Press reported. His party was also leading in congressional and governor’s races.
The electoral results will give López Obrador broad power to reshape public policy, which has largely been set by pro-American, free-market-oriented politicians in recent decades.
The peso dropped about 1 percent on news of his victory, not as dramatic a slide as some had predicted, but a sign the markets are skeptical of López Obrador’s platform, which includes higher spending on welfare programs.
López Obrador has tried to quell the concerns, saying he would not increase taxes or the public debt and would respect the country’s private sector. He has also said he is not interested in bringing Venezuelan-style socialism to Mexico.
Preliminary results suggested members of his Morena party would take at least 260 of the 500 seats in the House and roughly 65 of 128 seats in the Senate, but it is not likely to get the two-thirds advantage needed to change the constitution directly.
Although he has spoken bitterly about President Trump for nearly two years, López Obrador said he desires ‘‘friendship and mutual respect’’ with the United States and expects to hold talks with the president on issues such as migration and trade.
Trump tweeted his congratulations to López Obrador Sunday night, adding: ‘‘I look very much forward to working with him. There is much to be done that will benefit both the United States and Mexico!’’
López Obrador, 64, a longtime leftist standard-bearer and former mayor of Mexico City, scored a stunning victory by promising to battle corruption and improve the lives of the poor. He has pledged to increase subsidies to the elderly and people with a disability, provide scholarships to students, and reexamine a 2013 restructuring to liberalize Mexico’s state-run oil industry.
During the campaign, many mainstream politicians and business executives expressed concern that such economic policies could present a danger to Mexico. But after his victory, his rivals struck a conciliatory tone, calling Sunday’s result a triumph of Mexican democracy.
One of López Obrador’s pledges is to reduce the size of the pensions given to retired presidents. In response on Monday, former president Vicente Fox tweeted a picture of him and other former Mexican heads of state dressed in rags, with the caption: ‘‘If it’s for the good of Mexico.’’
López Obrador’s main opponents, Ricardo Anaya and José Antonio Meade, conceded Sunday night.
In his victory speeches, López Obrador called on Mexicans to reconcile and said his government would represent all citizens. ‘‘We will respect everyone,’’ he said at a downtown hotel. ‘‘But we will give preference to the most humble and forgotten.’’
López Obrador’s supporters gathered by the thousands Sunday night in the Zocalo, Mexico City’s main plaza, chanting the president-elect’s name as mariachis performed.
López Obrador’s victory represents an emphatic rejection of the traditional politicians whom he regularly calls the ‘‘mafia of power.’’ His role models are Mexican independence and revolutionary leaders who stood up to more powerful foreign countries.
López Obrador’s critics warn he will be more combative toward the United States than the current president, and the US-Mexico conflict could drastically escalate if he chooses to fight with Trump.
In prior years, López Obrador was a critic of the North American Free Trade Agreement, or NAFTA, but he and his team have insisted they want to preserve it and maintain good relations with Trump.
Trump has regularly attacked Mexico for not doing enough to stop drugs, crime, and undocumented immigrants from entering the United States. He has also initiated a renegotiation of NAFTA, saying Mexico has stolen US jobs, and intends to build a border wall.
During the campaign López Obrador’s messages have remained largely consistent — eradicate corruption, invest in the poor, fight inequality — but got a warmer reception this year because of mounting frustration after a series of scandals in President Enrique Peña Nieto’s administration and ever-growing drug-war violence.
Peña Nieto, who was constitutionally barred from running for reelection, is among the most unpopular presidents in decades. His Institutional Revolutionary Party (PRI), which ruled Mexico for most of the past century, fared poorly in the elections, and Meade finished in third place.