Venezuelan electoral board president Tibisay Lucena says the ruling Socialist Party has won 17 governorships, versus five for the opposition.
President Nicolas Maduro's government has won a majority of governorships, according to official election results, drawing fraud suspicions from the opposition whom polls had shown was poised for a big win.
Electoral board president Tibisay Lucena said on Monday the ruling Socialist Party took 17 governorships, versus five for the opposition Democratic Unity coalition, with results irreversible in all but one of the 23 states.
"'Chavismo' is alive, in the street and triumphant," a beaming Maduro said in a speech to the nation, referring to the ruling movement's name for former president Hugo Chavez.
Minutes earlier, opposition leaders had said the pro-government election board was about to announce dubious results.
"We have serious suspicions and doubts," election campaign chief Gerardo Blyde, told reporters, after opposition leaders had said earlier they were sure of a "gigantic" victory based on their observers.
Instead the opposition took just five governorships, including the restive Andean states of Merida and Tachira, plus the oil-producing western region of Zulia.
The government won back populous Miranda state, which includes part of Caracas, for an up-and-coming star of the Socialist Party, Hector Rodriguez, the election board said.
And Chavez's younger brother, Argenis Chavez, held the rural state of Barinas, where the family comes from.
The ruling Socialist Party had previously controlled 20 of 23 state governorships but opinion polls had shown the opposition coalition set to upend that, given voter anger at hunger and shortages stemming from an economic meltdown.
Sunday's surprise results raised the prospect of more unrest in Venezuela, where four months of opposition-led protests earlier this year led to 125 deaths, thousands of arrests, and widespread destruction of property.
During the gubernatorial campaign, the government made liberal use of state resources in its candidates' campaigns, evoked popular former leader Chavez at every rally, and appealed to Venezuelans' exhaustion with political turmoil to vote against "candidates of violence".
"I vote because I want peace, not terrorism," customs official Franquelsi Anciana said in western Maracaibo city.
Maduro has said all governors, including the five new opposition ones, must swear allegiance to a controversial new legislative superbody elected in July.
But the opposition does not recognise the entirely pro-government Constituent Assembly, which supersedes all other institutions, including the opposition-controlled congress.