With most votes counted, the USP has 49% while the opposition has about 43%.
The opposition was ahead in most of the larger cities, including the capital, Caracas, while the governing party won in rural areas.
The elections have been seen as a key test for President Nicolas Maduro, who replaced the late Hugo Chavez in April.
Since November, Nicolas Maduro has been ruling by decree, promising to tackle corruption and control price rises.
The opposition accuses Nicolas Maduro of failing to deal with crime, inflation and a shortage of basic goods.
Local elections in Venezuela are usually low key, but this one was filled with expectations for the government and the opposition.
Voters were electing mayors to 337 municipalities and officials to more than 2,000 city councils.
The opposition won mayoral races in the capital, Caracas, and the country’s second city. Maracaibo. They also won the capital of Barinas, from where former Hugo Chavez hailed.
So far, the USP has won in 196 of the municipalities being contested, while the opposition took 53, and independents another eight. The remainder have yet to be declared.
Nicolas Maduro called the results a “grand victory”, telling supporters at a rally in Caracas that “the Bolivarian Revolution continues now with more strength”.
The opposition’s failure to win a majority of the votes cast or significantly increase the number of municipalities under its control from the 46 won in the 2008 local elections was a disappointment to its leader Henrique Capriles.
Sunday’s elections coincided with the anniversary of Hugo Chavez’s famous speech in which he announced that his cancer had returned and named Nicolas Maduro as his preferred successor.
iRGPn5SwiqcAt least 158 people have died in Spain's worst flooding disaster in generations. On October…
Google has been fined two undecillion (a two followed by 36 zeroes) roubles by a…
Embarking on a home remodel is an exciting journey, promising enhanced comfort, increased property value,…
The US presidential candidates continued to campaign across key swing states on October 20. Footage…
Elon Musk has said he will give away $1 million a day to a registered…
India and Canada have decided to expel their top envoys along with other diplomats as…