MEXICO CITY — President Andrés Manuel López Obrador’s coalition hung on to its control of congress in midterm elections on Sunday but lost its supermajority in the lower house, according to preliminary results that indicated one of Latin America’s most popular leaders could face new limits on his power.

Analysts said the results were relatively positive for López Obrador’s nationalist, anti-establishment movement, given the problems that have assailed Mexico on his watch: a devastating coronavirus pandemic, an economic crash and unrelenting violence. His Morena party could pick up more seats as parties engage in horse-trading to strengthen their voting blocs.

“He won but he didn’t triumph,” Daniel Zovatto, a political analyst at the pro-democracy organization IDEA International, told the news program “Aristegui Noticias.”

Still, he noted that AMLO, as the president is known, will need to negotiate with other parties to pass any ambitious changes. In addition to its congressional tally, Morena was also poised to add at least seven governorships nationwide to its previous six. But it suffered a sharp reverse in politically influential Mexico City, a key electoral base for López Obrador, losing the leadership of nine of the 16 boroughs.

López Obrador appeared unbowed by his party’s reverses. He said Monday that the results “will favor the continuation of our transformation of Mexico.”

The biggest prize in the elections were the 500 seats in the lower house of Congress, where López Obrador had hoped to maintain the supermajority he assembled after his landslide 2018 win. Morena won between 190 and 203 seats in Sunday’s vote, according to projections by the national electoral institute. With several small parties, it could control around 280 seats, short of the two-thirds needed to pass constitutional amendments.

Also up for grabs were nearly half the country’s 32 governorships and thousands of positions in local government. It was Mexico’s largest election ever, thanks to an overhaul that moved balloting for many posts to the same year.

More than half of eligible voters cast ballots, an unusually high number for a midterm election — never mind one occurring during a pandemic.

López Obrador’s opponents framed the vote as one of the most important in recent Mexican history. They fear he wants to steer this country — the No. 1 U.S. trading partner — back toward the kind of one-party authoritarian system that prevailed for most of the 20th century. Critics compare the Mexican leader to populists such as Brazilian President Jair Bolsonaro and Salvadoran leader Nayib Bukele, who have demonized adversaries and rebuffed judicial challenges to their authority.

López Obrador’s view of the election was no less stark. He portrays his efforts to reduce poverty and graft as a “transformation” that will end free-market policies that entrenched deep inequality. “We don’t want to return to that regime of corruption, of injustice, of privileges” for the well-off, he said.

After the 2018 election, Morena formed a coalition to control more than two-thirds of the votes in the lower chamber of Congress. The governing party wasn’t able to assemble a similar supermajority in the Senate, however, making it difficult to pass controversial constitutional amendments.

Senators are not up for reelection this year. Still, the vote could wind up scrambling political alliances. Opponents worried the president could win enough support to push through amendments to reverse free-market overhauls of the energy sector and weaken autonomous institutions created to strengthen Mexico’s democracy.

“There have to be counterweights,” said Inés Candano, 26, a lawyer in Mexico City’s well-to-do Polanco neighborhood who voted for an opposition coalition. “In any presidency, one person should not have so much power.”

Morena was created by López Obrador, and draws strength from his popularity, which has remained high despite the economic crisis and more than 300,000 deaths from covid-19, according to official estimates. His approval ratings hover around 60 percent.

Alejandro Moreno, a pollster for El Financiero, says such support reflects Mexicans’ affection for the folksy, plain-spoken leader, rather than his policies. “When we look at indications of performance, like how the government is doing in handling the economy or crime or corruption, he gets very bad numbers,” he said.

Daniel Martínez, 35, who was selling sandwiches in Iztapalapa, a low-income borough of the capital, said he backed Morena in part because he identified with the president. López Obrador “comes from the ‘pueblo’ too,” he said. “He worries about us.”

Martinez said his family benefited from a government stipend for buying food and school supplies. Such social programs help explain why López Obrador remains a “Teflon president,” said another pollster, Jorge Buendía. Many Mexicans don’t blame him for the coronavirus crisis because it was a global phenomenon.

There’s another important factor, says Federico Estévez, a political scientist at the Autonomous Technological Institute of Mexico. “This has been an incredibly incompetent government,” he said. “But the opposition is even more incompetent.”

Mexico’s traditional parties have been discredited by corruption and their failure to deliver strong economic growth or reduce violence tied to organized crime.

Nonetheless, voters in Mexico City appeared to be punishing Morena for the stunning death toll from covid-19 in the capital — the epicenter of the domestic outbreak — and a metro accident that killed 27 people last month.

Midway through his six-year term, the president hasn’t proved to be the radical leftist that some of his opponents feared. López Obrador has drastically cut the bureaucracy, expanded the role of the military and pushed for a stronger government presence in the energy sector. He has supported free trade and defended a balanced budget.

Still, even some of his supporters have been unsettled by his willingness to challenge democratic norms and rules. In April, López Obrador’s party voted to extend the four-year term of the Supreme Court chief justice, an ally of the president — a move legal experts called blatantly unconstitutional.

López Obrador has pledged to respect Mexico’s ban on presidential reelection. But Luis Rubio, president of the think tank México Evalúa, told Uno TV the action generated tremendous uncertainty. “Once he broke the institutional framework, we entered a very different era,” he said.

Read more: