The Democratic Unity Roundtable (MUD) took 99 seats to just 46 for the United Social Party of Venezuela (PSUV), Tibisay Lucena, president of Consejo Nacional Electoral announced.
"Venezuela, we won!" said opposition key figure Henrique Capriles, governor of the state of Miranda. "I always told you all, this was the way! Humility, maturity and serenity. Long live the people of Venezuela!"
Venezuelans across the country displayed their participation in the voting by sharing photos of ink-dyed fingers on social media.
Setback for Chavismo
The election results are seen as a major setback to the ruling party. This is the first time in 17 years that Chavismo has not won a nationwide election in Venezuela.
"This is a victory for democracy," said Jesus Torrealba, executive secretary for the MUD.
"It's a historic victory, now begins the time for change in Venezuela!" he said to cheering supporters who chanted "Libertad, libertad" at the victory rally at MUD headquarters in Caracas.
President Nicolas Maduro took to the airwaves and announced that he accepted the loss of his majority, but pledged not to give up on the mission of deceased Hugo Chavez to create a socialist state.
Maduro recognized his party's loss and assured Venezuelans he will respect the results. He blamed the defeat on "the economic war" waged by political interests inside and outside Venezuela.
"I feel at peace with my conscience because everything we have done has been for the protection of the country," Maduro said in the national address.
The vote comes as the oil giant faces major economic inflation, a crippling recession and a rise in violence and insecurity.
A Pew Research Center poll
this week showed 85% of Venezuelans are dissatisfied with the direction the country is taking.
It also echoes a shift to the right seen in Argentina last month when Mauricio Macri won the presidential election
promising to rewrite the playbook on the country's economy. Latin America as whole has been grappling with an economic slowdown.
There are still 22 undefined legislative seats because the races are too close to call.
This victory gives ample powers to the opposition which, up until now, was greatly diminished.
The new National Assembly doesn't take power until early January with a term that lasts for five years.