People queue at a polling station in Caracas's Baruta municipality in Venezuela during elections Sunday seen as a crucial test for the government. (Federico Parra/AFP/Getty Images)

Venezuela's electoral council declared pro-government candidates the overwhelming winners in Sunday's key state elections, even though the opposition — which opinion polls had shown poised for widespread victories — cast serious doubt on the results.

In Sunday's vote to elect the governors in all 23 Venezuelan states, the pro-government electoral council said government candidates had won in 17 states, with the opposition capturing five and one remaining too close to call. But opposition officials, who had predicted an almost inverse outcome, suggested possible fraud — saying they would not recognize the results while calling for an independent audit.

"The results don't reflect reality," said Gerardo Blyde, head of the opposition coalition's campaign. "Venezuela and the world won't buy it. The government can't explain the results."

The results could spark a fresh round of international condemnation and further sanctions on the authoritative government of President Nicolás Maduro. After a vote in July creating a pro-government super-congress loyal to Maduro that was widely decried as fraud, President Trump labeled Venezuela a dictatorship and increased sanctions against Maduro and his government while warning that more could come. European Union nations also are considering sanctions.

Late Sunday, however, Maduro hailed the results not only as a victory for his socialists, but as proof of his government's commitment to democracy.

"This is one more victory," he said on state TV. "The path is democracy. The path is elections — not violence, not economic war."

[Venezuela’s government is turning Trump’s threats into a call to arms]

The stakes were dampened by Maduro's insistence that all winners would serve under the authority of his new Constituent Assembly, an all-powerful national legislature run by some of his closest allies. But it was nevertheless seen as a key test of Maduro's willingness to give space to the opposition.

Earlier in the day, Venezuelans went to the polls with the opposition decrying "obstacles and illegalities." The government put the turnout at a relatively high 61 percent — a level at which key pollsters had predicted the opposition would win sweeping victories. Government officials issued thinly veiled threats against crying fraud.

"If someone in the opposition decides to cry fraud in this election, he disappears as a political option in Venezuela forever," said Jorge Rodríguez, a senior Maduro backer and mayor of the capital's Libertador district. "I just say that as advice." Opposition officials campaigned hard for seats, even as they accused the government of sabotage.

Earlier Sunday, Blyde said many voting centers had opened late because of tardy government-appointed witnesses. Pro-government messages, he said, were still appearing on state TV in violation of election laws.

In Maracaibo, Venezuela's second-largest city, witnesses said on social media that groups of masked men broke car windows, stole purses and threw molotov cocktails at an opposition tent. Government officials did not mention those alleged attacks, but said that at least 26 "electoral crimes" had been committed, including some by people who tried to damage voting machines.

The pro-government National Electoral Council last week abruptly decided to relocate hundreds of voting centers — mostly in opposition districts — for "security reasons." On Sunday, many voters arrived to find that their polling stations had been moved to poor, often pro-government neighborhoods, where some voters feared to go.

At one center located at a school in northeast Caracas, a sign informed voters that they were now registered to cast ballots in a nearby slum. "They put up this obstacle so that we'll give up and go back home," said Ignacio Sánchez, a businessman who lives nearby.

Sánchez was sitting with a dozen neighbors, waiting for buses that the opposition promised to send to take them to their new polling place.

One man said his adult children had returned home because they didn't want to go through the trouble of voting elsewhere. "But that's what they want," said a 74-year-old neighbor, María de Alba. "Voting is resisting."

Yet the opposition also faced a hurdle in the form of anti-government Venezuelans who felt that opposition leaders should have boycotted the state elections, as they did the July vote.

In Plaza Francia, the center of the opposition protests that shook Venezuela earlier this year and in which more than 100 people died, Janeth Hernández, a woman in her 50s, sat on a park bench. She said she was abstaining.

"I'm not going to vote," Hernández said. "If you vote, you contradict yourself. So many deaths in protests, all for an election? All the politicians are the same here. Liars. If I vote for the opposition, the government isn't going to let them work. If I vote for the government, they're going to rob money and do nothing. I see no solution here."

At a voting center in the inner-city slum of Petare, the spray-painted eyes of Hugo Chávez — who anointed Maduro his successor before his death in 2013 — greeted voters alongside the name of the pro-government candidates. Salsa music was sounding as national guardsmen and pro-government militias organized the long lines.

After casting their ballots, some voters proceeded to a tent where they could register to claim allocations of free food. Pro-government neighborhood activists have suggested a link between voting and government aid — a considerable incentive in a nation suffering from a brutal economic crisis that has led to severe shortages.

"For the food, you know," said José Blanco, a 57-year-old unemployed driver, handing over his ID to a government worker after casting his vote.

On Sunday, state channels showed Maduro walking in the presidential palace with a cup of coffee, and images of pro-government candidates and officials casting their ballots. One of them, Edwin Rojas, the government's candidate in the state of Sucre, declared, "Today, peace wins; future wins; the Venezuelan people win."

"We will show Donald Trump and his agents here in Venezuela . . . that we prefer to vote and chose our own destiny," Rojas added.

Faiola reported from Miami.

Read more:

Venezuela’s chief prosecutor, a leading critic of President Nicolás Maduro, is ousted

In Venezuela, the economy may yet do what the opposition couldn’t

Today’s coverage from Post correspondents around the world

Like Washington Post World on Facebook and stay updated on foreign news