Former Brazilian President Luiz Inacio Lula da Silva was briefly detained for questioning on Friday in a federal investigation of a vast corruption scheme, fanning a political crisis that threatens to topple his successor, President Dilma Rousseff.

Lula's questioning in police custody was the highest profile development in a sweeping graft probe that has rocked Brazil's political and business establishment and deepened the worst recession in decades in Latin America's biggest economy.

The investigation threatens to tarnish the legacy of Brazil's most powerful politician, whose humble roots and anti-poverty programmes made him a folk hero, by putting a legal spotlight on how his left-leaning Workers' Party consolidated its position since rising to power 13 years ago.

Police picked up Lula at his home on the outskirts of Sao Paulo and released him after three hours of questioning. They said evidence suggested Lula had received illicit benefits from kickbacks at state oil firm Petroleo Brasileiro SA in the form of payments and luxury real estate.

The evidence against the former president brought the corruption investigation closer to his protegee Rousseff, who is fighting off impeachment for allegedly breaking budget rules, weakening her efforts to pull the economy out of a deepening downturn.

News of Lula's detention sparked a rally in Brazilian assets as traders bet that the political upheaval could empower a more market-friendly coalition. The real currency gained more than 3% against the US dollar and the benchmark Bovespa index climbed nearly 5%. Shares of the state oil giant Petrobras led the rally with a 14% surge.

A spokesperson for Lula did not immediately respond to requests for comment on Friday.

Lula's foundation said in a statement that his detention was "an aggression against the rule of law and Brazilian society." The foundation, which has consistently denied any wrongdoing by Lula, called the detention "arbitrary, illegal and unjustifiable."