CARACAS, Venezuela — The governing party of President Nicólas Maduro was dominating municipal elections across Venezuela late Sunday, winning nearly all major cities, according to early results, and further consolidating Mr. Maduro’s power as the country enters a presidential election year.

Candidates of Mr. Maduro’s United Socialist Party of Venezuela took the mayoralties in all but one of more than 40 principal municipalities, according to the national election authorities. Mr. Maduro, in a rambunctious, rambling address in the capital’s Bolívar Plaza, declared that the final count would show that his party had won more than 300 of the 335 seats being contested.

“We have obtained a big victory!” he exclaimed. “A popular, democratic, free, sovereign victory of an independent country!”

The breadth of the apparent sweep by Mr. Maduro’s party should not have surprised anyone: After the unexpected defeat of most of its candidates in regional elections in October, a broad but fractious alliance of opposition parties announced that it was boycotting the municipal contests to protest what it called a rigged, corrupt electoral system that favored the president and his party.