Top Brazil judge strips Lula of office after he rallies supporters

(Adds Lula speech, details of protests)

By Daniel Flynn and Anthony Boadle

SAO PAULO/BRASILIA, March 18 (Reuters) - A top judge in Brazil ruled on Friday that Luiz Inacio Lula da Silva should be stripped of a ministerial role so he can be investigated for graft, minutes after the ex-president rallied tens of thousands of supporters behind embattled President Dilma Rousseff.

In a move likely to inflame tensions between the judiciary and Brazil's leftist government, Supreme Court justice Gilmar Mendes said Rousseff's decision to name Lula her chief of staff appeared designed to shelter him from prosecutors' charges of money laundering.

Lula's appointment on Wednesday, which sparked protests in several cities, means only the Supreme Court can investigate him, placing him beyond the reach of a crusading judge heading Brazil's biggest ever graft probe into corruption at state oil company Petrobras.

"It would be plausible to conclude that the appointment and subsequent swearing-in could constitute fraud of the Constitution," Mendes said in his ruling. His decision to suspend Lula from ministerial office can be appealed before a plenary session of the court.

The opposition branded Rousseff's appointment of her charismatic political mentor as a desperate bid to shore up support in her Workers Party against impeachment proceedings, which picked up speed in Congress on Friday, as well as a means of protecting him from prosecutors.

At a rally in Sao Paulo's central Paulista Avenue, tens of thousands of Workers' Party supporters cheered Lula as he promised that his return to government would bring a greater emphasis on returning the recession-striken economy to growth and creating jobs.

"We have a long time before 2018 to turn around the fortunes of this country," Lula said, referring to the next presidential elections, for which he has suggested he could be a candidate. "There will not be a coup."

Pollster Datafolha estimated some 95,000 people took part in the Sao Paulo demonstration. Tens of thousands more participated in pro-government protests in Rio de Janeiro, while police said more than 5,000 joined a rally in the capital Brasilia in front of Congress.

Hours earlier, riot police had fired water cannon and tear gas to disperse anti-government protesters who had blocked the same central Sao Paulo thoroughfare since Wednesday, when demonstrations erupted against Lula's appointment as minister.

CLOCKING TICKING ON IMPEACHMENT

In the lower house of Congress, opposition parties hurried along impeachment proceedings against Rousseff by holding a session on Friday, when lawmakers are usually away from the capital.