Opponents of Hugo Chávez made major gains yesterday in legislative elections that could weaken the president's dominant power in Venezuela.

The opposition overturned Chávez's two-thirds majority in the national assembly, and claimed to have won most of the popular vote. If it were confirmed, the result would mark a milestone.

With most of the votes counted, the Democratic Unity coalition won at least 65 of 165 seats in the assembly – well short of a majority, but enough to inhibit Chávez's ability to appoint judges and other officials and to push through laws.

The opposition claimed that it had won 52% of the popular vote but argued also that changes in electoral rules favouring rural areas, where Chávez is popular, meant that this support had failed to translate into proportional seats.

Both sides claimed victory and momentum for the 2012 president election, in which Chávez will seek a third consecutive term. Turnout was 66%, high for a legislative election.

Chávez's allies took at least 98 seats. The remaining two seats went to a splinter left-leaning party. The president said via Twitter that his PSUV party was the victor. "Well, my dear compatriots," he wrote, "it has been a great election day and we have obtained a solid victory: enough to continue deepening Bolivarian and democratic socialism. We need to continue strengthening the revolution!"

He did not address supporters from the balcony of Miraflores palace, a tradition from previous elections.

During the campaign, the former soldier said it was crucial to "demolish" the opposition and win at least 110 seats for the two-thirds majority required to continue to rubberstamp his decisions.

State media reported the result as confirming the country was "red, very red", a slogan referring to the socialist party's colour. Aristobolu Isturiz, an assembly member and head of Chávez's campaign, said he had hoped for a two-thirds majority ,but was happy to have won a comfortable absolute majority. The opposition had been defeated, he said.

Television pictures from the rival camps told their own story: PSUV supporters in red T-shirts looking uncertain, and opponents in yellow and blue T-shirts appearing upbeat.

Opposition media, Venezuela is so polarised few are neutral, said the result punctured the president's near-hegemonic power. A decade-long authoritarian drift had been checked, said the Caracas daily Tal Cual. "This Monday morning is clearer and brighter, we won't allow the shadows to return."

Ramón Guillermo Aveledo, leader of the opposition coalition, said it had been a marvellous day but lambasted the national electoral council for an eight-hour delay before announcing the first, incomplete results at 2am local time to a tense country. The council, mostly made up of government loyalists, listed assembly winners but failed to immediately supply a breakdown of the popular vote. This is a benchmark for Chávez, who declared the election a referendum on his rule.

Opposition leaders claimed gerrymandering had robbed them of representation proportional to their 52% of the popular vote. Some analysts estimated the opposition's tally at 49.6%.

"It looks like a 50-50 nation, and that strengthens the opposition. If Chávez had won 53% or 54% of the popular vote, there wouldn't have been any qualms about his controlling the assembly," said Steve Ellner, a political analyst at the University of the East. Such an even split suggested the government should try to modify its radical discourse and accommodate the opposition, as long as it accepted the government's legitimacy, he said. Losing the popular vote, if confirmed, would be a "psychological handicap" for Chávistas, said Ellner, but the president's assembly majority was enough to keep his socialist agenda on track. "This result will slow things down but doesn't disable him."

Since sweeping to power in 1998, Chávez has cast his revolution as that of the poor majority against wealthy oligarchs. Two years ago, however, Caracas and other cities voted for opposition mayors and governors. Recession, inflation and crime played into the opposition's hands again this time.

The president's once-stellar approval ratings have tumbled but he remains the country's most popular politician, and he has a firm grip on all state institutions.

The assembly has acted as a rubber stamp since the opposition boycotted the last legislative election in 2005, giving Chávez free rein to push through radical legislation and appoint judges and members of the electoral council.

By securing more than 58 seats, the opposition can in theory exert influence over appointments and legislation; if it gets 67 – which seems possible – it could block the president's requests for temporary decree powers. Aveledo warned the outgoing "moribund" legislature against rushing out radical laws before the new assembly starts, in January 2011.

What they said

"The opposition got 61 and we got 99 seats, I don't understand how they call that a triumph. This result reaffirms us as the primary political force in the country."

"Chávez is the big loser. A different Venezuela, a majority, a plural national assembly … put the brakes on a long decade of authoritarianism and humiliation. This country finally stood up and said enough."

"If there are mistakes, I would never give up the opportunity that the revolution offers to rectify and overcome obstacles … If I were Venezuelan, even under thunder and lightning, I would fight to the limit to make 26 September a great victory."

"Worried sick about a country that is able to rob in such a shameful way the popular will. At least now the opposition mood is combative and Chávismo is on the defensive, no matter how many seats they robbed."