Updated

The man who led efforts to impeach Brazil's suspended President Dilma Rousseff resigned on Thursday as speaker of the lower house of congress, but kept the congressional seat that could help shield him from corruption charges.

Brazil's top court already had suspended Eduardo Cunha from his duties over allegations of obstructing justice and corruption, including holding Swiss bank accounts worth millions of dollars in bribes.

Cunha kicked off the proceedings against Rousseff in December 2015, accusing her of violating fiscal laws, which the embattled leader denies.

Cunha's allies have suggested that resigning the speakership would be his best chance to survive a full house vote that could strip him of his congressional seat and thereby eliminate legal protections enjoyed by lawmakers.

Brazil's lower house will have five sessions to elect a new speaker, and Cunha is expected to be a key voter in that election regardless of today's decision.

Cunha was in tears as he announced his resignation, saying he hopes it ends the chaos in Brazil's congress.

"Only my resignation can put an end to this endless instability. The lower house cannot wait forever," he said.

He also said he is being persecuted by investigators for pursuing Rousseff's impeachment. Brazil's Senate is to hold the impeachment trial after the Olympics end in Rio de Janeiro on Aug. 21.

Cunha wished luck to acting President Michel Temer, who accepted a number of Cunha's recommendations for key appointments in his administration.

Cunha entered politics in the 1990s as a fundraiser for former President Fernando Collor de Mello, the first Brazilian leader elected after military rule ended in 1985.

Cunha's power weakened when a plea bargain deal led to testimony linking him to multimillion-dollar Swiss bank accounts that allegedly were stocked by corruption centered on the state-run oil giant, Petrobras.

On Wednesday Cunha repeated his insistence that he is innocent.

Then-Attorney General Rodrigo Janot last year filed corruption charges against Cunha and Collor, who is now a senator. Janot said the two men took part in the sprawling corruption scheme at state-run oil company Petrobras in which billions in bribes were allegedly paid.