With almost 14 years as president of Bolivia under his belt, Evo Morales was one of the longest serving leaders in Latin America - and his country's first indigenous leader.
After a controversial decision by the constitutional court to scrap presidential term limits, Mr Morales ran for a fourth consecutive term in office in October 2019.
But the result of the presidential election was disputed, and Mr Morales' main rival, Carlos Mesa, cried foul - leading to weeks of unrest across Bolivia. Eventually international election monitors called for the result to be annulled - and on 10 November, Mr Morales delivered a televised statement announcing his resignation.
BBC News looks at some highs and lows of Mr Morales' political career.
Reclaiming the coca leaf
Evo Morales was born in a rural village in the western Oruro region into a family from the Aymara indigenous group.
He cut his political teeth as the leader of a union of coca growers. Coca, the raw ingredient of cocaine, has been used in the Andes for thousands of years for religious purposes as well as to combat altitude sickness and as a mild stimulant.
Mr Morales first ran for president in 2002, promising to govern in favour of Bolivia's indigenous people, who had suffered centuries of marginalisation and discrimination.
While not successful at first, he won the top job on his second attempt in December 2005.
13 years, 9 monthsin power
38 yearsleading the coca growers' union
54%of the votes won in 2005 election
64%of the votes won in 2009 election
61%of votes won in 2014 election
Once in power, he threw his weight behind a new constitution, which officially declared Bolivia as "plurinational" and secular in order to better reflect Bolivia's dozens of ethnic groups.
He also continued to fight for the rights of coca farmers, keeping coca-growing legal and introducing measures to regulate its trade despite pressure from the United States to eradicate the crop altogether.
The US authorities accused President Morales of not doing enough to stem cocaine production and trafficking, while he insisted he was combating cocaine production while allowing small amounts of coca to be grown for religious and cultural purposes.
Mr Morales' relations with the US were strained throughout his presidency.
In 2008, he expelled US Ambassador Philip Goldberg, accusing him of conspiring against his government, and suspended the operations of the US Drug Enforcement Administration in Bolivia.
In 2013, he also ousted the US Agency for International Development (USAID), accusing it of supporting his opposition.
Mr Morales was part of the "pink tide" of left-wing leaders which swept to power across South America in the early 2000s, a tide which has since ebbed with most of the left-wing leaders replaced by conservative governments.
An avowed socialist, Mr Morales cut his own salary and the salaries of those in his cabinet shortly after taking office.
He then began the process of renationalising the oil and gas industries. The increased tax revenue allowed Bolivia to vastly increase its public investment and helped boost the country's foreign reserves.
The administration invested heavily in public works projects and social programmes to fight poverty. Since he came to office, extreme poverty dropped from 38% in 2006 to 17% in 2018. However, his critics point out that in the last two years, the levels of extreme poverty have been on the rise again.
President Morales's left-wing policies worried and in some cases antagonised many middle-class Bolivians who saw him as too radical.
Opposition has been concentrated in the wealthy eastern lowland province of Santa Cruz, Bolivia's economic powerhouse.
His critics also accused him of failing to tackle corruption, which many Bolivians named as their main concern in the October 2019 presidential election.
Access to the sea
One of his main defeats was his failure to secure landlocked Bolivia access to the sea in a dispute with neighbouring Chile, a topic of national pride for many Bolivians.
The country lost its access to the Pacific Ocean in 1884 after a war with Chile and has tried to regain it ever since.
In October 2018, the International Court of Justice ruled in favour of Chile - a major setback for Mr Morales, who had assured Bolivians that victory was "very close".
Evo Morales has regularly spoken at international climate conferences, where he has argued for greater respect for "Mother Earth".
However, he has not always been successful in balancing that intention with economic development.
One of the most contentious issues of his presidency involved plans for the construction of a major road through the Amazon, which indigenous groups argued would open their territory up to illegal logging and land grabs.
Large-scale protests led to violent clashes and forced the government to backtrack in 2011. The project later got the go-ahead in 2017, with Mr Morales dismissing international concern as a form of "colonial environmentalism".
More recently, in 2019, Evo Morales faced protests over fires, which raged in protected eastern areas of the country.
Demonstrators called for him to revoke a decree that authorised "controlled burning" to help farmers create bigger plots for crops.
Many of those who turned out to protest against Mr Morales's response to the fires also carried placards accusing him of ignoring the result of a 2016 referendum.
The question posed in the referendum was whether Bolivians wanted to drop the limit of term numbers that Bolivian presidents can serve.
A majority voted "no" but President Morales's party took the issue to the constitutional court, which abolished the term limits altogether.
Critics of Mr Morales say his government rode roughshod over the will of the people by standing for a fourth term in office.
Mr Morales argued that he needed more time to carry out all the reforms he had set off to achieve.
However, his apparent victory in the election sparked weeks of protest, while international monitors said they had found "clear manipulations" of the election result.
This led to his resignation less than a month later. In a televised address, he told the nation: "I resign my post as president."