A month after a disputed general election that resulted in the ousting of long-term President Evo Morales and protests that left dozens dead, Bolivia is finally showing some small signs of recovery.
On Sunday, the country's self-proclaimed interim president, Jeanine Anez, approved legislation that annuls the disputed October 20 election, limits presidents to two terms preventing Evo Morales from running again and appoints a new board that will set a date for a new general election.
The move, which came on the back of negotiations between the representatives of the provisional government and Morales's Movement for Socialism (MAS) party, is aimed at defusing ongoing street violence and bringing some normalcy to a country grappling to mend the stark divisions between supporters of the ousted president and opponents seeking to move beyond his nearly 14-year rule. Anez said she hoped the legislation would help generate "a national consensus".
The path to this point has been rocky. When Anez and her right-wing backers first took power, they seemed uninterested in any form of compromise and tried to beat their MAS party rivals into submission through threats. Morales was forced to resign after the military suggested he did so, while the remaining top MAS leadership was also intimidated into stepping down.
The pressure campaign against MAS officials included the burning of their houses and intimidation directed at their relatives. The new government also menaced journalists covering the country's political crisis, saying that it would not tolerate "seditious" media, even though it later backed down under international pressure. Moreover, Anez gave the military a carte blanche to repress pro-Morales protests, resulting in the deaths of at least 23 people with 715 more wounded.
While Anez and her local and international backers are undoubtedly the main culprits behind the chaos and bloodshed that engulfed Bolivia in recent weeks, Morales and his MAS party are not blameless for the deterioration of Bolivia's democracy that led to these tragic events.
Some 15 years ago, when another interim government took control of Bolivia following the resignation of President Carlos Mesa amid mass protests, things looked significantly different.
The Chief Justice of the Supreme Court, Eduardo Rodrigues Veltze, took over as interim president in June 2005, but unlike Anez, he made it very clear from the beginning that he had nothing on his agenda other than overseeing the election of a new president. He handed over the presidency in January 2006 when Evo Morales won the vote, postponing every possible political decision to the new administration.
In 2009, after a successful first term which saw one of Latin America's poorest countries prosper economically, Morales won another election by a resounding margin.
Even though the 2009 constitution introduced a two-term limit for presidents, Morales ran for a third term in 2014, arguing that the term he served prior to the introduction of the limit did not count. While his decision to run raised some eyebrows and led some in the international community to question his dedication to the rule of law, he once again scored an easy victory on the back of his significant achievements as president.
But in February 2016, when a referendum was held on whether Morales should be allowed to run for yet another term, the charismatic and popular president's fortunes turned south. In a country with a long and painful history of dictatorships, alarm bells went off. Despite support for both the president and the ruling party remaining high, Morales's proposal to abandon term limits was voted down by a 51.3 percent majority.
If Morales had accepted defeat and chosen a successor then, Bolivia would have been in a very different situation today. He, however, refused to take the Bolivian public's message on board. A year and a half later, in a feat of legal manoeuvring, the constitutional court ruled that to not allow Morales to run again would violate his human rights. As a result, all term limits were promptly annulled, and Morales was once again declared the presidential candidate for the MAS.
Morales and his party's apparent disregard for the constitution undoubtedly played a role in creating the circumstances for the illegal confiscation of Bolivia's presidency by the right. But at the heart of Bolivia's current dilemma is a problem that is much bigger than any single president or political party: a weak political infrastructure.
In a presidential system, division of powers is essential to provide the needed checks and balances, particularly on the executive branch. In countries, like Bolivia, dependence on an extractive economy leaves governments particularly vulnerable to outside interference.
Bolivia has never had much of an independent, or even functional, judiciary that could keep checks on the president. And with the legislature being controlled by Morales's own party, there was limited institutional oversight of the actions of the president.
The executive's control over the legislature is not a malfunction that is specific to the Morales government. Bolivia has never had strong political parties that could keep their leaders in check. In fact, political parties in Bolivia are usually built around particular personalities and ebb and flow with their rise and fall from power.
A transfer of leadership within a major political party has happened once in Bolivia's modern history and that was in 1956 when the Revolutionary Nationalist Movement founder Victor Paz Estenssoro passed the baton on to Hernan Siles Zuazo.
While this history does not excuse Morales's insistence on holding onto power, it helps to explain how a party like MAS that started off as the political arm of a peasant movement gradually became an extension of its powerful leader.
International organisations and foreign states also played a role in Bolivia's meltdown. From Brazil to the US, right-wing governments throughout the region have worked to unseat the left's last man standing in Latin America. But the Organization of American States (OAS), which receives 60 percent of its budget from the US, played a particularly troubling role in Morales's downfall.
Luis Almagro, the Uruguayan head of the 35-member organisation, gave Morales the green light in 2016 to run for a fourth term, enraging Bolivia's opposition and puzzling many analysts. But when the vote went forward some three years later, and Morales came out as the clear frontrunner, his organisation rapidly issued a statement casting doubt on the integrity of the elections.
The organisation's "preliminary" report suggesting "serious irregularities" was instrumental in the rapid-fire process that led to Morales's resignation. Some analysts who examined this report have raised questions about how much actual fraud there was. A final report that was supposed to be published some two weeks ago, has not yet materialised.
Although the events of the past month have changed Bolivia's political landscape drastically, there is little doubt that MAS remains the largest political force in the country. Fraud or no fraud, it garnered significantly more votes than its nearest rival.
The future of the country is now dependent on MAS remembering the reasons behind its founding over 20 years ago and reconstituting itself as a party that fights for the interests of the majority of Bolivians and not the political future of a single charismatic leader.
To make sure the local and international right-wing forces that worked to bring down Latin America's only remaining left-wing government do not succeed in the long term, MAS needs to acknowledge that it has misjudged the public's growing dissatisfaction with what increasingly looked like one-man rule. It needs to recognise that by supporting Morales' attempts to hold on to power beyond constitutional limits it paved the way for Bolivia's electoral process to be sabotaged by an orchestrated rightwing seizure of power.
The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial stance.