MEXICO CITY — He was the last of the so-called pink tide leftist leaders who swept to power in Latin America more than a decade ago.

As president of Bolivia, Evo Morales oversaw brisk economic growth and an expanding middle class in a nation long among the region’s poorest — even as critics assailed what they called his authoritarian tendencies.

The United States, meanwhile, bristled at his anti-U.S. rhetoric and his alliances with fellow socialist leaders across the region.

His resignation Sunday has reignited debate over his leadership — and left Bolivia in turmoil without a head of state as all of his constitutionally designated successors also quit.

The government of Mexico said Monday night that it had offered Morales political asylum and that he was aboard a Mexican government airplane en route from Bolivia.

“It hurts me to abandon the country for political reasons, but I will always be ready,” Morales wrote on Twitter. “Soon I will return with more strength and energy.”

Morales, who was elected the nation’s first indigenous president in 2006, stepped down after the head of the Bolivian army called on him to resign after weeks of massive protests about an election that his critics say was rigged to deliver him a fourth term.

He had already agreed to new balloting after a team from the Organization of American States found widespread irregularities in the Oct. 20 voting. But Morales insisted that he was a victim of powerful forces allied against his socialist policies.

Bolivia’s Legislative Assembly was planning an extraordinary session Tuesday to discuss the political crisis gripping the landlocked Andean nation of 11 million.

On the streets of La Paz, the capital, crowds of jubilant Morales foes set off firecrackers and blocked major thoroughfares, while enraged supporters set ablaze barricades leading to the country’s major airport.

Morales, whose country has lived through numerous military coups, said his forced resignation was part of that pattern.

“They try and blame us for the chaos and violence that they have provoked,” he wrote on Twitter. “Bolivia and the world are witnesses to the coup.”

President Trump celebrated the resignation, tweeting Monday that it was “a significant moment for democracy in the Western Hemisphere” and a warning to other leftist governments in the region.

“These events send a strong signal to the illegitimate regimes in Venezuela and Nicaragua that democracy and the will of the people will always prevail,” he wrote.

Morales was an avowed admirer of ex-Cuban leader Fidel Castro and former Venezuelan President Hugo Chavez, both longtime U.S. adversaries.

The Bolivian leader came to office pledging to be a “nightmare” for policymakers in Washington and vowing to dismantle U.S. anti-drug efforts. Bolivia is a major producer of the coca leaf, the raw ingredient in cocaine, and Morales once headed the nation’s coca-growing farmers federation.

He also parlayed his humble origins — he was a former llama herder, sugar-cane cutter, and trumpet player in a traveling band — into a national platform that tapped into deep disgust with a political status quo long dominated by a white and mixed-race elite with close ties to the United States and multinational corporations.

As leader, however, he eschewed Venezuelan-style, large-scale expropriations of private property and presided over steady economic growth, much of it fueled by soaring commodity prices. That boom has largely ended, however, raising questions about whether the nation can maintain its economic ascent.

On Monday, Morales turned to Twitter to call for calm.

“I ask my people with much affection and respect to maintain the peace and not fall into the violence of groups that seek to destroy the state of law,” he wrote. “I am making an urgent call to resolve whatever differences with dialogue and agreement.”

Mexico said it had granted political asylum to Morales after he personally called Marcelo Ebrard, the Mexican foreign secretary, seeking refuge there.

“A tradition of protection of asylum seekers has characterized Mexico for much of its history,” Ebrard said in a statement.

A statement Sunday from army chief Gen. Williams Kaliman, who called on Morales to resign “for the good of our Bolivia,” left the president with few options. It remained unclear whether the military would move to fill the power void, as has happened many times in Bolivian history.

Carlos Mesa, the opposition leader who finished second in last month’s balloting, also urged Morales to step aside.

But Morales maintains strong popular support, especially among indigenous residents with origins in the country’s highlands.

Morales, who turned 60 last month, came to office in a wave of left-of-center but generally pragmatic presidents, including those in Brazil, Chile and Argentina. But conservative, pro-U.S. governments later replaced many of them.

In Washington, a senior State Department official said in a telephone briefing with reporters that Bolivians were “upholding the constitution and democratic practices” that Morales had violated or ignored.

The Trump administration rejected the coup label because of what it considers strong evidence of electoral fraud and because of questions over whether Morales should have been allowed to run for a fourth term.

McDonnell and Wilkinson reported from Mexico City and Washington, respectively. Special correspondents Cecilia Sanchez in Mexico City and Andres D’Alessandro in Rio de Janeiro contributed to this report.