In 2006, he became Bolivia’s first Indigenous president since the country’s independence from Spain two centuries ago. He quickly moved to empower Indigenous people, redistribute the nation’s natural gas wealth and bring infrastructure to poor communities, measures that made him the most popular Bolivian politician in decades.

Benefiting from the commodity boom in the 2000s, Mr. Morales transformed Bolivia, one of South America’s poorest nations, into one of its most dynamic economies, lifting millions out of poverty. Unlike his high-spending left-wing allies in Venezuela and Argentina, however, Mr. Morales combined redistribution with maintaining a balanced budget and wooing international investors.

He easily won two re-elections, bringing political order to Bolivia, which had suffered chronic instability for decades.

How did Mr. Morales fall?

In recent years, Mr. Morales’s economic success was marred by increasingly authoritarian measures. He steadily tightened his grip on power, prosecuting opposition figures, packing the courts and electoral boards with allies and unleashing bands of his supporters to intimidate opponents.

And he sought time and again to hold onto power. By 2016, when he had already spent 10 years in office, a majority of Bolivians decided Mr. Morales had overstayed his welcome, voting in a legally binding referendum to prevent him from running for another term. His party took the case to Bolivia’s Constitutional Court, which ruled that term limits would violate the president’s human rights.

As he embarked on his fourth presidential election campaign this year, his formerly unassailable approval ratings began to melt, diminished by his aloof handling of disastrous wildfires and disdain for democratic procedures.

The popular discontent finally erupted into protests after the vote on Oct. 20, when officials abruptly stopped releasing results and stayed silent for 24 hours. When the count resumed, electoral authorities declared that Mr. Morales had won outright and did not need to face a runoff.