ONCE again, the light of progress is going out across Latin America. Brazil, loudly trumpeted this decade as a shining example of global economic development, is on the brink of a constitutional coup to unseat President Dilma Rousseff — a process that could return the country to chaos and dictatorship.

Other Latin American nations, principally Venezuela, are at the same dangerous crossroads. But wobbly Brazil is special and not because it is hosting the Olympic Games. With a population of more than 200 million, Brazil is the world’s seventh largest economy, measured by purchasing power parity. In other words, Brazil is a problem right on our own doorstep. It is also the story of how a national popular movement against austerity can fail disastrously.

The backstory is this. Like most Latin American countries, Brazil is divided between a rabidly right-wing, white middle class (drawing its wealth from a narrow base of commodity exports and rentier income) and a mass of poor people of mixed race. History has oscillated between authoritarian governments to protect the establishment and populist presidents swept to power (temporarily) by the masses. Because neither side has been able to transform the economy decisively – to break out of the cycle of dependency on commodity exports – political instability and endemic corruption have been the norm. Only four of the eight presidents elected in Brazil since 1950 served their full term in office.

To hold the balance, Brazil has lapsed frequently into military dictatorships of the nastiest kind. The last such dictatorship was from 1964 to 1985. The trouble with most military dictatorships is that the generals and admirals are useless at economic modernisation and give the local middle class a bad reputation when they take holidays in Europe (all those cattle prods and dropping liberals from aeroplanes over the mid-Atlantic). So for a generation Brazil has tried to stay roughly democratic and generate enough economic growth to pacify the biggest working class on the continent. Sheltered behind high tariff walls, the Brazilian economy even managed to diversify into “normal” domestic manufacturing, making steel, cars, planes and computers. Finally, in 2002, a new mass Workers’ Party, led by charismatic trade unionist Lula da Silva, won the presidency.

The Workers’ Party has been victorious in the last four presidential elections. The economy boomed and living standards appeared to boom with it. In 2011, Lula handed over the presidency to his hand-picked heir Dilma Rousseff, Brazil’s first woman president and a former guerilla fighter against the military dictatorship. Even after the banking crisis griped the US and Europe in 2008, the Brazilian economy continued to grow. The country became the “B” in the famous BRICs acronym – Brazil, Russia, India and China – signifying the newly dynamic part of a globalised trading economy.

Then everything went pear-shaped. Or rather, the old cycle of economic crash and unrest has reasserted itself. Inflation and high unemployment have returned, hurting both the working class and the middle class. As a result, Rousseff is extremely unpopular, while a huge corruption scandal has engulfed the Workers’ Party, including former hero da Silva. True, much of the Brazilian working class thinks the grounds for impeaching President Rousseff are contrived. But the Brazilian middle classes have taken to the streets in their hundreds of thousands to demand it.

WHY did the Workers’ Party experiment go wrong? In fact, much of Brazil’s recent economic miracle was a sham. Though elements of the economy were modernised, da Lula and later Rousseff relied on the massive rise in global commodity prices – the result of Chinese demand – to boost Brazil’s exports of oil and basic food stuffs. This one-off surge in export earnings allowed the Workers’ Party to make cash transfers to the poor – the so-called Bolsa Família.

But Lula and Rousseff were also clever enough to pursue another policy. Taking advantage of near-zero interests rates across the globe, the Workers’ Party encouraged a massive increase in domestic consumer borrowing. From 2005 to 2015, private debt in Brazil jumped from 43 to 93 per cent of GDP. This was achieved by letting banks take interest payments direct from workers’ wage packets. Soon interest on household credit was absorbing a fifth of disposable income.

Rousseff won the presidency in 2011 by promising even more economic growth. But as global oil and commodity prices peaked and started to fall (a consequence of Chinese over-expansion) Rousseff took fright and introduced austerity measures to balance the books. The central bank raised interest rates to a ruinous 14.25 per cent and – predictably – the Brazilian economy nosedived. Both working class and middle class found themselves in desperate debt. Brazil was suddenly back in political, as well as economic crisis.

Worse still, with the end of good times, it became obvious that the Workers’ Party machine was corrupt to its core. The party’s genuine left wing had been expelled or driven out in the early 2000s. The shell that remained did nothing to build a popular base. Instead, it relied on public largesse and low interest rates to keep the masses diverted while party functionaries dipped their hand in the till. Result: two presidents of the Workers’ Party, two treasurers, a president and vice-president of the lower house of the Brazilian parliament, plus the leader of the party in the upper house, have found themselves in jail for corruption.

Now the finger has been pointed at Lula himself. He is accused of corruption linked to the state-owned oil company, Petrobras. To protect him from arrest, Rousseff has appointed Lula her de facto prime minister, a post which grants him legal immunity from prosecution. As a result, the right-wing in parliament is moving to impeach Rousseff. Of course, corruption also extends to the middle class parties. More than 300 of the legislators voting to impeach President Rousseff are themselves under investigation for corruption, fraud or electoral crimes. That’s over half the Brazilian parliament. But this crisis is not about corruption per se – it is about class and power.

The financial markets in Brazil are betting that removing Rousseff would result in a more business-friendly administration led by Vice President Michel Temer, of the centrist Brazilian Democratic Movement. Sources “close to the vice president” (i.e. Temer) told Reuters news agency that he would appoint a senior executive of Goldman Sachs, the American investment bank, to run the economy. Which might explain why Hillary Clinton is desperately fending off demands from Bernie Sanders, her socialist rival for the Democratic nomination, to publish secret strategy speeches she gave to Goldman Sachs executives — for which she was paid $675,000. (Not a campaign contribution, you understand.)

There are lessons here. A progressive party – even one with mass support and genuine appeal – only retains popularity by going forward and delivering the dreams of the many. If that party concedes ground to compromise — economic and social — then its popularity will ebb. Again, a progressive party needs to draw on the strength of its mass base through popular mobilisation, to ensure reform proceeds despite opposition from entrenched interests. The Workers’ Party might still be able to mobilise such popular resistance but it has left matters a mite late in the day. Let’s never make the same mistake.