Caracas - Venezuelan President Nicolas Maduro declared victory in local elections as his ruling Socialists won a majority of votes nationwide, even though they lost to the opposition in five key cities.
The Sunday polls did not turn out to be the referendum on Maduro the centre-left opposition had hoped for.
Nevertheless opposition candidates made major inroads by winning in Venezuela's five most populous cities, including Caracas, the oil city of Maracaibo, and in a highly symbolic victory Barinas, Chavez's birthplace.
Maduro, aged 51, was narrowly elected to office in April, one month after his popular predecessor died of cancer. His tenure has been marked by high inflation, a soaring crime rate, and a shortage of household items like toilet paper and milk.
Leftist "Chavistas" have been in power in oil-rich Venezuela since Chavez first took office in February 1999.
Maduro's Socialists won nearly 50% of the overall vote against 43% for the opposition, said National Electoral Council (CNE) president Tibisay Lucerna, with nearly all of the polling stations reporting.
"The Venezuelan people have told the world that [Chavez's] Bolivarian Revolution continues with even more force," Maduro said at an outdoors post-vote rally in Caracas. He described the vote as a triumph "of love and loyalty" towards Chavez.
Maduro then called on opposition leader Henrique Capriles to show "humility," to "recognise that he has been defeated again" and resign.
The Socialists won office in 196 municipalities and the opposition in 53, according to the CNE. Some results remain undeclared.
The results send a "very clear message," said Capriles at a press conference. "Venezuela is a divided country, it has no owner. We are building an alternative and will not rest until Venezuela is united."
Capriles alleged that the vote was marred by scores of problems at polling stations, including broken machines.
The approval ratings for Maduro, a former bus driver, leftist stalwart and cabinet minister were plunging when, in November, the National Assembly granted him power to rule by decree for one year to fight corruption and respond to what he has called an "economic war" unleashed by the opposition with US support.
He quickly rolled out a series of measures to force price cuts, notably on household appliances and cars, and threatened speculators with prison.
Pre-election surveys showed that Venezuela's middle class welcomed this populist show of force from the self-styled "avenging president".
At a time when Venezuela has been experiencing months of record 54% inflation and facing shortages of basic household goods, "a crazy paradox occurs: the one who is benefiting from the crisis is Maduro," pollster Luis Vicente Leon told AFP.
For political scientist John Magdaleno, Sunday's vote shows "significant advances" by the opposition by winning the mayor's office in three large cities that previously had pro-government mayors.
Their vote numbers also increased compared with the 2008 local elections, Magdaleno said, but were less when compared with the controversial April presidential election, which Maduro won over Capriles by a wafer-thin margin of 1.5%.
While Maduro has no room for mistakes, the opposition's challenge is to remain united and have a strong showing in the 2015 mid-term elections, said Magdaleno, head of the Polity consulting firm.
While the opposition shows "significant growth," it has been unable to "punish" Maduro at the ballot box, added Luis Vicente Leon, head of the Datanalis consultancy.
The government showing at the polls however was a letdown for supporters like Luis Lugo, who met with some 300 other loyalists in a Caracas plaza to follow on a giant TV screen the official results as they came in.
The failure of the Socialists to win in four of the five biggest cities was nothing short of "treason," Lugo sneered.
Despite their overall victory, the rally was much smaller than in years past, and there were no fireworks or dancing to celebrate as there used to be under Chavez.
Nearly half of Venezuela's voters cast ballots, in line with previous turnouts, election officials said.