CARACAS, Venezuela — Security forces violently repressed protests that broke out in Venezuela’s capital on Friday after the Supreme Court gutted the opposition-controlled Congress of its last vestiges of power, drawing widespread condemnation from other countries and even triggering a rebuke from the nation’s normally pro-government chief prosecutor.

Governments across Latin America condemned the power grab, which the head of the Organization of American States likened to a “self-inflicted coup” by socialist President Nicolas Maduro. The United Nations’ top human rights official expressed “grave concern” and called on the high court to reverse its decision.

In Caracas, national guardsmen in riot gear fired buckshot and swung batons at a group of students who gathered outside the Supreme Court. Several protesters were arrested and some journalists covering the demonstration had their cameras seized by the police.

Residents of eastern Caracas, the site of weeks of anti-government unrest in 2014, awoke to an eerie calm, while the main opposition alliance called for a rally Saturday.

The Supreme Court ruled late Wednesday that as long as lawmakers remained in contempt of court rulings that nullified all legislation passed by the chamber, the high court, or an institution it designates, can assume the constitutionally assigned powers of the National Assembly, which has been controlled by the opposition for nearly a year and a half.

In a surprise pronouncement, Chief Prosecutor Luisa Ortega Diaz, normally a government loyalist, said it was her “unavoidable historical duty” as a Venezuelan citizen and top judicial authority to denounce what she called the Supreme Court’s “rupture” of the constitutional order.

“We call for reflection, so that the democratic path can be retaken,” she said to the loud applause of several aides gathered around her.

The ruling and another limiting lawmakers’ immunity from prosecution capped a feud that began when the long-marginalized opposition won control of the legislature by a landslide in December 2015 and then mounted a campaign to force Maduro from office. The leftist leader, who has seen his approval ratings plunge amid food shortages and triple-digit inflation, responded by relying on the Supreme Court to unseat several lawmakers.