Election officials in Venezuela say the opposition has won control of the country's legislature, delivering a stunning defeat to the ruling Socialist party.

Authorities say the opposition, with two seats yet to be determined, won 110 of the 167 seats in the National Assembly, with the Socialist party winning just 55.

Winning the other two seats would give the opposition coalition a two-thirds majority in the National Assembly, potentially allowing it to fire Supreme Court justices, begin a process that would recall the president, even call an assembly to rewrite the constitution.

Whether the opposition achieves the supermajority or not, the results are a major setback for the long-dominant, ruling socialists who have led the country for 16 years.

Opposition leaders vowed Monday to use their new majority to free jailed opponents of the Socialist government, but also said they would not move to dismantle popular welfare policies.

It is the first time the "Chavismo" movement, named for former socialist president Hugo Chavez, has lost its majority in the assembly, and gives the opposition a platform to further erode President Nicolas Maduro's power.

The 53-year-old president, who was handpicked by Chavez, quickly accepted defeat in a televised speech to the nation early Monday that calmed fears of violence.

Venezuela's President Nicolas Maduro arrives at a polling station to vote during congressional elections in Caracas, Venezuela, Sunday, Dec. 6, 2015.

The vote is widely seen as a popular rebuke to Maduro's government for the deep economic and social crisis in the oil-producing country.

United States Secretary of State John Kerry congratulated Venezuelans for "expressing their overwhelming desire for a change" and "making their voices heard in a peaceful and democratic way."

He pledged U.S. support for facilitating dialogue among all parties in Venezuela "to address the social and economic challenges facing the country."

A survey last month estimated 55.6 percent of voters would back the opposition coalition.

Venezuela has the world's largest oil reserves, but plunging oil prices have left the South American country with one of the world's highest inflation rates, widespread product shortages and long lines to shop for basics.

Opposition leaders have long accused the administrations of Chavez and Maduro of repressing dissenting voices and jailing rival politicians and activists.

Venezuelan authorities arrested three people last week accused of killing opposition candidate Luis Diaz in the the central state of Guarico. Diaz was shot in late November while attending a political rally alongside Lilian Tintori, the wife of imprisoned opposition leader Leopoldo Lopez.

Government officials denied any link to Diaz's death.

On Saturday, Maduro met with the former heads of state of Bolivia, Colombia, Costa Rica and Spain who are serving as international observers of the election.