The Brazilian Congress has voted not to send President Michel Temer to face trial for corruption.
Opposition lawmakers in the lower house of Congress failed to obtain the two-thirds majority needed to send the case to the Supreme Court.
Mr Temer has been accused of receiving $12m (£9m) in bribes from the boss of a giant meatpacking firm, JBS. He has denied the allegation.
The Congress session was marred by scenes of chaos and angry exchanges.
Lawmakers shouted abuse, pushed each other and threw fake bank notes at their opponents.
Voting is continuing, but more than one-third of lawmakers have either voted against a trial for President Temer, or abstained, meaning that the opposition cannot reach the two-thirds target required to send him to the Supreme Court.
The opposition needed to get 342 out of 513 votes.
Left-wing Congressman Ivan Valente, of the Socialism and Liberty Party, demanded the ousting of Mr Temer and the holding of new elections.
"The Brazilian people do not want Temer, the Brazilian people want direct elections. We do not want to change six for half-a-dozen. Out with Temer! Direct (elections) now!" he said.
- All you need to know about Brazil's corruption scandals
- Temer steps out of the shadows to lead Brazil
The lengthy session descended into chaos earlier, when both sides traded accusations of corruption.
Pro-government lawmakers displayed inflatable dolls depicting former President Luiz Inacio Lula da Silva as a prisoner.
He was sentenced last month to nine years and six months in jail and is facing other charges of corruption.
Lula says all the accusations against him are politically-motivated.
Mr Temer's supporter say his dismissal would cause instability and damage Brazil's ailing economy.
"I am in favour of all investigations, but the moment we are living in is very delicate and we need to recover the economy," said Luiz Claudio from the centre-right Republic Party.
Mr Temer became president last year following the impeachment of his predecessor, Dilma Rousseff.
She was found guilty of tampering with the government accounts in order to hide a growing deficit ahead of her re-election in 2014.