Venezuela's opposition took majority control of the National Assembly on Tuesday after years in the political wilderness, setting the stage for a potential power struggle with embattled President Nicolas Maduro.

Lawmakers were sworn in during a heated parliamentary session that saw pro-government representatives walk out in protest after pushing their way onto the dais as the new leadership tried to lay out its legislative agenda.

It's the first time in 17 years, since elections in December 1998, that opponents of the socialist revolution begun by the late President Hugo Chavez have held a majority in the legislature, and many leaders seemed rapt in disbelief.

The opposition won a two-thirds majority in a landslide election victory last month, giving it unprecedented strength to challenge Maduro's rule. But that key super-majority is now in doubt after a government-stacked Supreme Court barred four lawmakers from taking their seats at the last minute while it considers allegations of electoral fraud. As a result, only 163 of 167 lawmakers were sworn in during Tuesday's ceremony.

Earlier in the day, hundreds of opposition supporters accompanied the incoming lawmakers past a heavy military barricade to the neoclassical legislature downtown. A few blocks away, a much larger crowd of government supporters gathered outside the presidential palace to lament the inauguration of what they call a "bourgeois parliament" intent on "legislating slavery."

The duelling marches were tame compared to the chanting and shoving inside the chamber.

APTOPIX Venezuela National Assembly

A government supporter on Tuesday carries a painting of Hugo Chavez, the late Venezuela president, near Miraflores presidential palace in Caracas, to protest the swearing in of opposition lawmakers. (Alejandro Cegarra/Associated Press)

Reflecting the changing political winds, journalists were granted access to the legislature for the first time in years and state TV broadcast interviews with opposition leaders. Conspicuously absent inside the domed building were the oversize portraits of Chavez giving a salute and independence hero Simon Bolivar that had been a fixture for years.

Instead, from the public gallery, the wife of jailed opposition leader Leopoldo Lopez held up a sign reading "Amnesty Now," referring to what's likely to be the legislature's first order of business: a law freeing dozens of activists jailed during anti-government protests in 2014 that resulted in dozens of deaths.

"Keep a strong hand!" 65-year-old Mary Mujica shouted as the incoming parliamentary president, Henry Ramos, muscled his way through the crowd. "There's a criminal conspiracy running the country; you can't negotiate with criminals."

Opposition lawmakers promise sweeping changes, while the socialists have been equally adamant that the legislature not erode social gains of Chavez's revolution.

The 72-year-old Ramos, a sharp-tongued, pre-Chavez-era politician who beat out moderates in the opposition coalition to take the president's gavel, reiterated in his inaugural remarks his commitment to six-month deadline to remove Maduro by constitutional means, echoing demands made by hard-liners during the 2014 protests.

Washington reaction

Moderates have criticized that strategy and instead advocate pragmatic steps to wrench the oil-dependent economy out of a tailspin marked by triple-digit inflation and the world's deepest recession.

What unites the two factions is an agenda of probing government corruption and freeing opposition figures that they and many human rights groups consider political prisoners. It's a polarizing issue that also promises to rally government supporters.

"It's completely illogical," the outgoing National Assembly president, Diosdado Cabello, said of the proposed amnesty law. "It's like the assassins pardoning themselves."

Jennifer McCoy, a longtime observer of Venezuela elections for a pro-democracy group founded by former U.S. President Jimmy Carter, said the coming weeks will tell whether the government and opposition can put aside their mutual hatred.

"This is the moment when both sides need to determine how to move forward: whether they are going to work together or engage in a battle royal," said McCoy, who is now director of the Global Studies Institute at Georgia State University.

The socialists began fighting the new congress almost as soon as it was voted in. Outgoing lawmakers appointed new members to the Supreme Court, which they hope will counter opposition legislation.

Maduro also issued a flurry of decrees Monday including one circumventing congress's power to approve the appointment of central bank board members. Ramos has vowed to review the executive orders.

On Tuesday, socialist lawmakers made derogatory comments from the floor about their new colleagues, and then walked out midway through the session.

A tired-sounding Maduro later commended the lawmakers for leaving the session, but added that his party would have to "get used to a new political dynamic in the country" and work hard to take back the ground lost in the legislative elections.

In Washington, the U.S. State Department congratulated Venezuela on the inauguration of a new assembly but said it remains "concerned" by controversy surrounding the delegates who have not been seated.

Wielding the gavel for the first time, Ramos appeared to relish his power to cut off rivals' soliloquies.

"I'm the timekeeper and your time is up," he told one lawmaker. He cut off another, saying, "Take it easy, congressman, things have changed here."

Ramos closed the session with a message to Maduro that the days of rubber-stamping executive decrees are over.

"We are not going to be a subordinate power like this National Assembly was until yesterday at midnight," he said.