A commission of Brazilian senators on Wednesday quashed a bid to expand criminal immunity for lawmakers after the proposal unleashed mass protests over the weekend.

A bill passed last week by the Chamber of Deputies would have allowed for lawmakers to vote by secret ballot whether or not to authorize one of their own to be charged with a crime, or arrested.

Tens of thousands of people took to the streets Sunday against what they dubbed a "Banditry Bill" seeking to entrench criminal impunity for elected officials.

The demonstrators also objected to a push for Congress to pass an amnesty law that could benefit far-right ex-president Jair Bolsonaro, who was sentenced this month to 27 years' imprisonment for coup-plotting.

Sunday's protests were the largest since the 2022 election victory of leftist President Luiz Inacio Lula da Silva, who Bolsonaro was found guilty of seeking to oust.

After the conservative-majority lower house passed the immunity bill with support from some Lula allies, it was unanimously defeated Wednesday by a commission that weighs proposed legislation before it is submitted to the full Senate -- the upper house of parliament.

Had it been approved, the bill would have scrapped dozens of cases before the Supreme Court against 108 of Brazil's 594 sitting parliamentarians, according to the O Estado de S. Paulo newspaper.

The cases target several Bolsonaro-aligned lawmakers implicated in spreading disinformation on social media, and a son of the ex-leader accused of encouraging the United States to interfere in the criminal case against his father.

The Bolsonaro movement accuses Supreme Court judges of persecuting its leader and right-wing legislators.

The bid to push through a potential amnesty for Bolsonaro is a separate process.