Brazil scandal
Brazil's President Dilma Rousseff (L) and former president Luiz Inacio Lula da Silva attend the appointment of Lula as chief of staff on 17 March, which was then blocked by a federal judgeReuters

Protesters in Brazil have been taking to the streets in their millions and the South American country is on the brink of a constitutional crisis after a judge blocked President Dilma Rousseff's appointment of her predecessor Luiz Inácio Lula da Silva to her cabinet .

The Brazilian government will appeal the decision which critics say was a move by Rousseff to shield da Silva from prosecution over corruption allegations.

The political intrigue comes only months before it is due to host the Rio Olympics, but who are the key players in the controversy and what is the background to the crisis?

Luiz Inácio Lula da Silva

The former president of Brazil Luiz Lula da Silva, known to most as simply Lula, was the head of state between 2003 and 2010. When he left office he had a 90% approval rating and was widely feted for lifting tens of millions of his people out of poverty.

However, investigators are looking into what part he played in a multi-billion dollar bribery scheme involving Petrobras that enveloped politicians, officials and key figures in the oil giant.

Police detained him on 4 March, while state prosecutors in his native Sao Paulo questioned him over whether he concealed the ownership of luxury apartment in the city, a case which has been handed over to Sergio Moror, the federal judge in charge of the Petrobras investigation.

The cabinet position that Rousseff appointed him to makes it impossible for him to be prosecuted without the permission of the Supreme Court. A process against him could take years and would be unlikely to rule against him.

Da Silva's lawyer Cristiano Zanin Martins said the accusations against his client were politically motivated.

He told Time magazine: "The ex-President was elected twice, with huge approval ratings. There was no suggestion of corruption. Then, when Brazil faces a crisis, suddenly he is being investigated. There was the possibility that he would run again in 2018. This is clearly aimed at stopping him."

Dilma Lula
An anti-government demonstrator (L) and a supporter of Brazil's President Dilma Rousseff clash before the appointment of former Brazilian president Luiz Inacio Lula da Silva as chief of staff, near the Planalto palace in BrasiliaRicardo Moraes/Reuters

Petrobras

Prosecutors say that starting in 2004, the top officials at the majority state-owned oil company colluded with a cartel of companies to overcharge the company for building and service work.

Bribes were given in return for favourable contracts and the scheme is said to involve political figures. One former employee said that he had earned $100m and the ruling Workers Party had pocketed up to $200m, according to the New York Times.

Protests took place in March 2015 with anger directed at Rousseff who was chairwoman of the company during part of the time under investigation although she denies wrongdoing and has not been charged. It is estimated that total of all bribes was nearly $3bn.

Dilma Lula
Protesters gather for a rally in Sao PauloLeonardo Benassatto/Reuters

Dilma Rousseff

The current president of Brazil was once the protégé of da Silva and she is under investigation for hiding the true state of the country's finances in 2014, using accounting trickery to hide the size of the budget deficit.

She was chairwoman of Petrobras when the graft at the oil firm was taking place, although Brazilians do not think she was involved, it raises questions over her competence.

She claims she appointed da Silva as her chief of staff because she believed he was a "skillful political negotiator." On a practical level, she needs da Silva. She is unpopular and some two thirds of people would like to see her impeached. As chief of staff, da Silva's role would have been to rally Congress behind Rousseff and help fend off her impeachment.

However, a poll for Reuters shows that two-thirds of Brazilians expected her to be removed from the presidency this year.

The phone tap

Added into the mix is the release of a phone conversation intercepted by police which the federal federal judge Sergio Moro released to the press.

In it, Rousseff tells da Silva she will send a nomination letter for him to sign "if necessary", which the judge who blocked his appointment referred to as an attempt to shield him from justice.

The president's office called the release of the recording a "flagrant violation of the law and constitution". Some critics say Moro went too far in releasing the wiretaps.

Dilma Lula
A demonstrator attends a protest over the appointment of Brazil's former president Luiz Inacio Lula da Silva as chief of staff, at Paulista avenue in Sao PauloPaulo Whitaker/Reuters

Public discontent

On 13 March, millions marched across Brazil in 200 cities demanding Rousseff leave office and four days later, protesters burnt tyres in front of the presidential palace in the capital Brasilia.

No one believes that Rousseff herself was involved in the bribes and kick-backs, but more protests are expected in the coming weeks.

The economy

Brazil had built a reputation for being an up and coming economy, its 7.5% growth it enjoyed in 2010 made it the poster child of the BRICS countries.

However, the Petrobras scandal has tarnished that standing somewhat and since those heady days, the economy has slumped considerably. The IMF forecasts Brazil's economy to shrink by 3.5% this year, after a 3.8% contraction. Worldfinance.com reported how the Petrobras affair has dented investor confidence and added an extra layer of pressure on the country's economy.

However, it is hoped the Olympics in Rio could offer some kind of boost. The Fifa World Cup in 2014 was supposed to cost $1bn and ended up costing $11bn and left a considerable deficit due to a lower than expected turnout.

This year's Olympics in August are scheduled to cost a little over $15bn and will be hoped to provide a much-needed boost to the country's economy. It is uncertain whether Rousseff will still be head of state when the opening ceremony takes place on 5 August.

Worldfinance.com reported: "The Olympics will hopefully serve as a way for the country to regroup, offering a short reprieve and a slight boost in economic activity at a time when the country needs it most."