CUENCA, Ecuador — In a move that Venezuela's opposition decried as a "coup," Venezuela's Supreme Court effectively shut down congress, saying it would assume all legislative functions amid its contention that legislators are operating outside of the law.

The decision will undoubtedly increase tensions in the South American nation where the opposition-controlled congress was seen as a last bastion of dissent. The move is also a slap to the international community, which just this week was pressing the socialist administration to respect the role of the legislature and to hold new elections.

On Thursday, Peru broke off diplomatic relations with Venezuela, calling it a "flagrant breach of democratic order" in the country.

In a ruling published late Wednesday, the Supreme Court said that while the National Assembly continued to defy court rulings all of its actions were "invalid" and that "the activities of the parliament would be exercised directly by (this court)."

The ruling essentially dissolves congress at a time when it was trying to push back against President Nicolas Maduro and the ruling United Socialist Party of Venezuela, or PSUV, which control virtually all the levers of power.

The opposition Voluntad Popular party called the move a "clear coup against our constitution and the National Assembly, which was elected by more than 15 million Venezuelans."

The power grab goes back to January 2016, when the National Assembly swore in three opposition representatives from Amazon state even as the court had decided to investigate their election amid suspicions of voter fraud. That investigation is ongoing and the opposition has said the court is simply trying to rob them of their super majority.

Wednesday's ruling not only reaffirmed the court's decision that the National Assembly is illegitimate but went further by granting itself legislative powers.

Opposition Congressman Freddy Guevara, with the Voluntad Popular party said the court decision wasn't "just another ruling" and called for street demonstrations and "democratic resistance" to defend the country's institutions.

"This ruling marks a point of no return for this dictatorship," he said.

"The best thing we can do as deputies, is keep going to the assembly and doing our jobs," he told Venezuela's El Nacional newspaper Thursday. "We can't run off."

He said deputies will also keep going before international bodies to "denounce these irregularities."

A senior official with the Atlantic Council called the move "a beating" to Venezuelan democracy.

"Maduro's dissolution of the National Assembly is more than a blow to Venezuelan democracy, it is a beating — yet another sign that the country's political system is crumbling and fast," Peter Schechter, the director of the Adrienne Arsht Latin America Center, said in a statement. "If there was any doubt before, there should no longer be one: Venezuela is a dictatorship."

"The region and all those countries interested in the welfare of Venezuela's citizens must come together," he added. "It is high time to stop negotiating with a government that clearly has no intention of reversing course. Indeed, it is time to treat Venezuela like the pariah state it has become."

On Monday, the Organization of American States debated whether Venezuela was fulfilling its democratic obligations. OAS Secretary General Luis Almagro has said the country needs to hold regional elections — which were supposed to take place last year — and said the government needs to respect congress, which is seen as the last official bastion for opposition voices.