Mr. Morales seemed to feel strongly that the changes he set in motion required him to stay at the helm of the government.

In 2016, when Mr. Morales was campaigning for a referendum that sought to do away with term limits, I asked to interview him in La Paz. Instead of agreeing to a traditional interview, the president asked that I spend an entire day trailing him — an offer he has often extended to foreign journalists.

I was struck by two things: his vanity and the extent to which the government had turned Mr. Morales into a brand. The first event of the day was a predawn workout in a police gym, during which the grunting president displayed his stamina and strength for a mystified audience of one.

Later in the day, as we flew to a couple of cities, Mr. Morales’s image was everywhere: stamped on murals in a new subsidized housing complex, on airport billboards and even on each cable car of La Paz’s futuristic public transportation system.

The first clear sign that Bolivians were growing weary of Mr. Morales came when he narrowly lost the term limits vote, his first electoral defeat as president.

Mr. Morales had struggled to persuade voters in large part because of a corruption scandal that broke days before the referendum. It involved a former girlfriend of the president who had used her access to the government to help a Chinese firm get contracts worth hundreds of millions of dollars.