Venezuela’s opposition has won a key two-thirds majority in legislative elections, according to final results, dramatically strengthening its hand in any bid to wrest power from President Nicolás Maduro after 17 years of socialist rule.

More than 48 hours after polls closed in the mid-term election, the National Electoral Council published the final tally on its website, confirming that the last two undecided races went the opposition coalition’s way, giving them 112 out of 167 seats in the national assembly. The ruling socialist party and its allies got 55 seats.

The announcement ends two days of suspense in which Maduro’s opponents claimed a much larger margin of victory than initially announced by electoral authorities.

The outcome, better than any of the opposition’s most optimistic forecasts, gives the coalition an unprecedented strength in trying to rein in Maduro as well as the votes needed to sack supreme court justices and even remove Maduro from office by convening an assembly to rewrite Hugo Chávez’s 1999 constitution.

Maduro’s comments following the results show he is likely to resist their efforts.

Even while recognising defeat in the parliament, the former bus driver and union organiser blamed the “circumstantial” loss on a rightwing “counter-revolution” trying to sabotage Venezuela’s oil-dependent economy and destabilise the government.

On Tuesday he visited Chávez’s mausoleum in the hillside slum where the government suffered a shock loss in Sunday’s vote. Accompanied by members of his top military command, he accused his opponents of sowing discrimination and class hatred, cautioning workers who voted for the opposition that they would regret their decision to abandon support for the government.

“The bad guys won, like the bad guys always do, through lies and fraud,” said Maduro. “Workers of the fatherland know that you have a president, a son of Chávez, who will protect you.”

Nicolas Maduro has said the loss was ‘circumstantial’. Photograph: HANDOUT/Reuters

Hardliners in the notoriously fractious opposition seem similarly inflexible, preferring to talk about ending Maduro’s rule before his term ends in 2019 rather than resolving Venezuela’s triple-digit inflation, plunging currency and the widespread shortages expected to worsen in January as businesses close for the summer vacation.

Moderates however are calling for dialogue to give Maduro a chance to roll back policies they blame for the unprecedented economic crisis. But with most Venezuelans bracing for more hardship as oil prices, the lifeblood of the economy, hover near a seven-year low, even they recognise the window for change is small and closing fast.

“If Maduro doesn’t change we’ll have to change the government,” said Henrique Capriles, who lost to Maduro in 2013 presidential elections. “But the opposition’s response to the economic crisis right now can’t be more politics.”