Venezuela Opposition win elections
Venezuelan opposition Democratic Unity Movement (MUD) party members celebrate after knowing the first results of the legislative election, at the headquarters in Caracas, on the early morning, Dec. 7, 2015. Getty Images/AFP/Luis Robayo

Opposition leaders in Venezuela won a majority in the legislative elections on Sunday while President Nicolas Maduro acknowledged the defeat -- the first challenge for the governing socialists in 17 years. Members from the Democratic Unity opposition coalition earlier said that they had won 100 seats of the 167-member National Assembly, but later reports said, citing official figures, that they won 99 seats while the ruling United Socialist Party of Venezuela won 46.

As polling in the country witnessed a massive turnout, electoral authorities also extended the voting by an hour, BBC reported.

"The results are as we expected. Venezuela won," former presidential candidate Henrique Capriles said on Twitter, adding: "With great humility, serenity and maturity we accept what the people decided."

A victory for the opposition leaders comes as a major setback for the socialist revolution started in 1998 by the late Hugo Chavez, who had a strong influence over the country’s long-excluded masses.

Maduro, who had earlier promised to defend the socialist system built by Chavez, appeared to have softened his tone on Sunday.

"In Venezuela, peace and democracy must reign," Maduro said, according to the Associated Press, after casting his vote in a working-class neighborhood in Caracas. "I've said we'll take the fight to the streets, but maybe I was wrong. We can't go where we've always been," he added.

Venezuela is struggling to tackle unchecked crime and shortages in basic goods while inflation has soared to triple digits. The crisis has worsened as most of the country's public spending is funded by oil revenues, which have witnessed a slump.