Brazil’s President Dilma Rousseff must wonder sometimes that with friends like her predecessor and mentor, Luiz InĂ¡cio Lula da Silva, who needs enemies.

Tensions between Ms Rousseff, a taciturn technocrat, and Mr Lula da Silva, a charismatic populist, have begun to take the twists and turns of one of Brazil’s sprawling telenovela soap operas, in which close friends and family often stab each other in the back.

For Ms Rousseff, who is facing the possibility of impeachment by an opposition emboldened by her growing unpopularity, the enemy within is the last thing she needs. For Latin America’s largest economy, which is sinking into its deepest recession since the 1930s, ruling party infighting will sap investor confidence only further.

Differences between Ms Rousseff, who was Mr Lula da Silva’s chief of staff during his eight years in power between 2003 and 2010, and her mentor have long been said to exist but rarely have they burst into the open as they have this month.

The latest spat erupted after Mr Lula da Silva, still the pre-eminent figure in the ruling leftist Workers’ party (PT), criticised the economic policies of Joaquim Levy, Ms Rousseff’s University of Chicago-trained finance minister.

After splurging on a sustained fiscal stimulus during her first four-year term between 2011 and 2014, Ms Rousseff appointed Mr Levy this year to clean up Brazil’s sinking public finances.

The problem for Mr Lula da Silva and the PT is that Mr Levy’s austerity programme, which includes clamping down on state bank lending and increasing interest rates to curb inflation, could not have come at a worse time. The party is already deeply unpopular over corruption at state-owned oil group Petrobras.

Worse, the recession has pushed up unemployment while inflation is rising – a double whammy for the PT’s core voters in the unions and working classes. With municipal elections looming next year, the PT worries that Mr Levy’s austerity programme will be a lightning rod for popular anger.

To try to distance himself and the PT from the government’s austerity measures, Mr Lula da Silva lashed out during a recent trade union congress, where he argued Ms Rousseff’s government was behaving like the more economically orthodox opposition PSDB party that it beat in elections last October.

The friendly fire forced Ms Rousseff to declare that the PT’s opinion was not that of the government and that Mr Levy had her full confidence.

Mr Lula da Silva’s apparent differences with Ms Rousseff may be little more than a show to keep the PT’s base onside. In practice, the supposed falling out with Ms Rousseff makes little sense because it follows a recent cabinet reshuffle that incorporated more politicians close to Mr Lula da Silva.

The former president has rarely been as intimately involved with the day-to-day running of Ms Rousseff’s administration than he is today, analysts say.

Mr Lula da Silva may have more personal reasons to take potshots at Ms Rousseff and the hapless Mr Levy.

The anti-corruption investigation into Petrobras has been creeping closer to the former president. In recently released court documents, a state witness in the Petrobras case implicated one of Mr Lula da Silva’s daughters-in-law.

Mr Lula da Silva has denied any wrongdoing. But if the heat from the Petrobras case continues to increase, it will not hurt the former president to have the support of party stalwarts on the street and in Congress.

The danger is that if he continues to do this at the expense of “comrade Dilma”, he could risk bringing the whole house down. Either Mr Levy could suddenly leave, a move that could spark a currency crisis. Or voters already angry at the PT over the recession and corruption could tire of telenovela-style politics and desert the party.