Mexico’s president Andrés Manuel López Obrador put a brave face on the loss of his congressional supermajority in midterm elections, saying he was “happy, happy, happy” with an outcome that he said reaffirmed popular support for his policies.

His Morena party and allies slipped from a two-thirds majority in the lower house of Congress — enough to change the constitution — to a simple majority. But Morena and its allies were set to win 11 of the 15 state governorships that had been up for grabs, ensuring that they will govern more than half the country.

Guadalupe Correa-Cabrera, associate professor at the Schar School of Policy and Government at George Mason University, said it was a “very, very good result” for the president despite the high death toll from the pandemic and an economy that has not yet rebounded to pre-Covid levels.

“Amlo [as the president is known] is a political animal and he knows that the result is precisely what he was expecting and maybe even a bit better,” she added. Incumbents in Mexico typically lose ground in midterm votes.

The peso rose to a five-month high of 19.8 to the dollar as fears of legal challenges to a messy election outcome faded.

“People voted to continue the transformation project,” the president said as official projections showed the ruling coalition of Morena and its allies garnering 281 seats, versus 219 for the opposition. Before the election, Morena and its allies had 334 seats, 256 of which belonged to Morena.

In Mexico City, however, where López Obrador was mayor from 2000-05, Morena lost ground. The capital has been the preserve of the left since the late 1990s but looked set to be split almost equally between Morena and opposition parties.

López Obrador ducked a question at a news conference on Monday about whether his party had been punished for the collapse of a metro bridge in May, which killed 26 people, and blamed the media for “day and night propaganda” against him.

“By not getting the results he was looking for . . . it’s probable [the president] will try to radicalise,” Jorge Zepeda Patterson, a political commentator, told Milenio Televisión.

Mario Delgado, leader of Morena, hailed what he called a “historic triumph” and said “you have to remember that we had to build a qualified majority. We didn’t win it in 2018, we made alliances.”

“I think in his heart of hearts the president’s disappointed . . . but he’s happily making lemonade out of lemons,” said Pamela Starr, a professor at the University of Southern California.

Marko Cortés, leader of the opposition National Action party — which teamed up with the Institutional Revolutionary party and Democratic Revolution party in the Alliance for Mexico bloc to challenge the governing coalition — said “the majority of Mexicans want to correct the country’s course”.

Luis Antonio Espino, a communication consultant, tweeted: “Amlo may not have had his Waterloo, but the opposition had its Dunquerque” — a reference to a turning point in the second world war.

López Obrador said he would speed up what he says is his transformation of Mexico, which is aimed at eradicating corruption and improving living standards for the poor.

Additional reporting by Eva Szalay in London