CARACAS, Venezuela—The ruling Socialist government in Venezuela early Monday claimed sweeping victory in local and state elections that for the first time in four years included the participation of most of the country’s beleaguered, U.S.-backed opposition movement.

With more than 90% of votes counted, President Nicolás Maduro’s party won all but three of the 23 state governor offices and most of the 3,000 races for mayor and municipal council positions that were up for grabs in Sunday’s elections, said the National Electoral...

CARACAS, Venezuela—The ruling Socialist government in Venezuela early Monday claimed sweeping victory in local and state elections that for the first time in four years included the participation of most of the country’s beleaguered, U.S.-backed opposition movement.

With more than 90% of votes counted, President Nicolás Maduro’s party won all but three of the 23 state governor offices and most of the 3,000 races for mayor and municipal council positions that were up for grabs in Sunday’s elections, said the National Electoral Council after midnight on Monday. About 41% of eligible voters cast a ballot, the lowest participation rate in regional elections in at least two decades.

The results weren’t a surprise in a country where Mr. Maduro controls resources, access to the press and most of the members of the National Electoral Council.

“The victory is impressive,” Mr. Maduro said, celebrating with supporters.

Some in the opposition took solace in winning a third of 335 mayor’s seats and the governorship of an oil-rich state, Zulia. Though opposition leaders said they expected to lose most of the races, the point of participating was to begin the baby steps in a strategy that includes using negotiations in Mexico with the regime to advocate for concessions so that future elections can be more free and fair.

As leverage, the opposition has the backing of the Biden administration, which has said that it could lift sanctions against regime officials and the oil industry if the government makes far-reaching, irreversible concessions that lead to democratic elections.

From a public park here in the capital, Juan Guaidó, who is recognized by the U.S. as Venezuela’s rightful president, on Monday afternoon acknowledged a new reality for the opposition, which has failed to unseat Mr. Maduro in recent years by demanding his ouster or triggering uprisings.

The way to battle the regime, Mr. Guaidó said, is to unite a fractured opposition, engage in talks in Mexico with Mr. Maduro’s aides and shoot for the next presidential elections.

“We have to get rid of Maduro, challenge him for power,” said Mr. Guaidó, who spoke with two flags of Venezuela at his side. “The next event, according to the dictatorship, are the presidential elections of 2024.”

The government didn’t immediately respond to Mr. Guaidó’s comments.

Mr. Guaidó recognized that what he called an accord in the future would need to involve Mr. Maduro—an important admission of the president’s power. He said that there would need to be “a progressive lifting of some sanctions” in exchange for more of a democratic opening for the opposition.

A senior State Department official said that the opposition’s participation in the elections Sunday didn’t legitimize Mr. Maduro. Rather, he said that the opposition’s participation has shone “a light on the fraud that has already been committed while defending what small pockets of democratic space remain.”

Guillermo Bolinaga, a Venezuelan who is partner of the U.S.-based consulting firm Opportunitas Advisors, said that while the regime took most of the votes Sunday, the opposition has a chance to rebuild.

“Against all obstacles, they have mobilized,” said Mr. Bolinaga. “That’s a hopeful sign for the opposition, who must now seek to reconnect with the people and offer a clear road map for change.”

Mr. Bolinaga said that the opposition also has to work to renew its leadership.

Since January 2019, the U.S. and dozens of other democracies have supported Mr. Guaidó after diplomats said widespread fraud marred Mr. Maduro’s 2018 presidential reelection. Mr. Guaidó’s role as head of congress legitimized him, but that term is set to expire Jan. 5. While U.S. officials say they will still recognize Mr. Guaidó into the future, some major wings of the opposition coalition have indicated a need for new leaders.

“Our biggest challenge after this process is to work on renewing leadership,” said opposition politician Tomás Guanipa, who worked for Mr. Guaidó and lost his race for mayor of one of the districts that make up Caracas. He said the opposition needs to work to reestablish itself with the people, who in polls show little support for its leadership.

“It’s about reconnecting with the country, taking to the streets of each neighborhood of Caracas and saying to people, ‘Here we are,’” said Mr. Guanipa.

Many voters, though, weren’t enthused by the vote, as evidenced by the high rate of absenteeism. Polls predicted millions of no-shows, with levels of voter apathy high as ordinary Venezuelans, exhausted by years of political confrontation, have been more focused on surviving in a difficult economy.

Though low turnout played to Mr. Maduro’s advantage, opposition leaders also decried irregularities at voting stations, which authorities allowed to stay open for hours after 6 p.m., when voting was supposed to have ended. A scuffle between pro- and antigovernment activists outside one voting center in western Zulia state left at least one person dead from gunfire and two others wounded, according to state security officials, who pledged to investigate.

“It feels like everybody in the country loses,” said street vendor David Alvarez, who was among two of the five adults in his family who voted. “It’s very disappointing.”

Write to Kejal Vyas at kejal.vyas@wsj.com and Juan Forero at Juan.Forero@wsj.com