The Senate passed an unpopular overhaul of Brazil's labour laws on Tuesday night, a move that was crucial for embattled President Michel Temer to show he has political support while trying to survive damaging corruption allegations.

Opposition senators had tried to block the vote with a sit-in at the president's rostrum, but the session resumed after a six-hour delay and in a vote on the measure's initial reading the body voted 50-26 in favour.

The bill is part of a programme being pushed by Temer that he says will get the economy going again.

Senators allied with the president did not take the opportunity to speak in favour of loosening work rules and other changes in the overhaul, which opinion polls indicate is widely unpopular with Brazilians.

"The Brazilian people know that this reform will not bring jobs," said Humberto Costa, leader of the opposition Worker's Party.

READ MORE: Brazil austerity move slammed as disaster for the poor

After a tense day, Senate President Eunicio Oliveira was able to resume the session from his chair in the early hours of the evening.

Rebellious senators commandeered the leaders' table on the rostrum early in the day and prevented Oliveira and some of his allies from taking their seats.

Oliveira responded by ordering the power and microphones cut off and he adjourned the session, leading to hours of negotiations behind the scenes while the opposition senators remained in the chamber.

After six hours, Oliveira took a seat at a smaller chair and restarted the session while having to shout to fellow senators and the rebels soon gave up the sit-in.

Brazil's acrimonious politics

The spectacle underscored how acrimonious Brazilian politics have become in recent months as Temer's popularity has plummeted and a corruption charge against him has emboldened members of the opposition who believe he should never have become president. Temer took power last year after his predecessor, Dilma Rousseff, was impeached and removed as president.

Given that Temer was only voted in as vice president in the last election, many Brazilians have bristled at his push to pass a series of unpopular economic measures, including a cap on government spending, an overhaul of the pension system and the loosening of work rules.

The most significant measure in the labour changes would allow agreements negotiated between employers and workers on a range of issues to override current labour law. The bill would also make it easier to hire temporary workers, even for extended periods of time.

Senators still had to debate whether any amendments should be made.

Oliveira and his allies hoped to get the measure passed in the Senate without any changes to the legislation that already was approved in the lower house. If passed by the Senate without changes, the bill would go directly to the president for signature. The opposition was demanding an amendment, which would send it back to the Chamber of Deputies for another vote.

Brazilian media have been predicting the bill would pass despite its low standing in polls. But the dramatic protest by opposition senators on Tuesday was a blow to Temer that raised further questions about his ability to govern.

Allies of the president are counting on a victory on the labour law to give the president a boost before the Chamber of Deputies votes on whether to suspended him from office and put him on trial for corruption.

That vote is not yet scheduled, but the speaker of the lower house of Brazil's Congress on Tuesday urged that it be held this week.

OPINION: What next for Brazil's decaying kleptocracy?

Speaker Rodrigo Maia of the Democrats Party said Brazil "cannot wait" for resolution of the first charge among several expected to be brought against Temer.

"We need to make a decision, to give a response to the prosecutor general's charge, so that we can continue voting on our agenda, and our agenda is the (economic) reforms," Maia told journalists.

If two-thirds of deputies vote against Temer, Maia would take over presidential duties while Brazil's Supreme Federal Court decided whether to remove the president or find him not guilty.

The prosecutor general has accused Temer of accepting bribes from a meatpacking executive in exchange for helping the company obtain favourable government decisions. He denies wrongdoing.