Updated

President Nicolas Maduro faces his first electoral test since being elected nearly eight months ago, as Venezuelans go to the polls on Sunday to judge his government's response to their nation's mounting economic troubles.

The vote for mayors and city councils in this deeply polarized country was bound to be competitive after Maduro defeated opposition leader Henrique Capriles by a razor-thin margin in the election held in April to choose Hugo Chavez's successor following his death from cancer.

Capriles has refused to recognize the results, alleging fraud

Since then, Venezuela's economic troubles have deepened, with inflation touching a two-decade high of 54 percent, and shortages of everything from toilet paper to milk spreading while the black market value of the currency plunges.

Not surprisingly, disapproval of Maduro's rule had been rising, especially within the coalition of ideological leftists and members of the military that he inherited from Chavez.

But the 51-year-old former bus driver has managed to regain momentum by going after groups and businesses he accuses of waging an "economic war" against his socialist government. Among the most popular measures: the seizure of dozens of retailers and the slashing of prices on plasma TVs, fridges and other appliances.

Local pollster Luis Vicente Leon says the offensive has helped boost president's approval rating to just over 50 percent, about the same level of support he garnered in the April election, from 41 percent in September.

Unlike the opposition, which claims it's the target of a campaign by Maduro to intimidate media that provide airtime to its events, pro-government candidates have also been helped by abundant coverage of almost-daily appearances by the president.

Maduro has also decreed Sunday a national holiday of "loyalty and love" for Chavez, whose legacy remains strong among poor Venezuelans.

The opposition is seeking to pick up votes in major cities — it currently holds just three of the top 10 most-populated districts, including the capital Caracas — and score a symbolic victory by taking the majority of the national total. In the last municipal elections in 2008, it won 46 municipalities, with another 10 going to dissident factions of Chavismo.

Pro-government candidates govern in the remaining of the 337 districts up for grabs on Sunday, many of them rural areas, and are hoping to thwart the opposition's gains by taking control of Maracaibo, the country's second-biggest city.

Barring an unlikely landslide for either side, the nation's political stalemate is likely to continue, raising doubts about whether Maduro will double-down on his current course of price controls and heavy state intervention in the economy or adopt a more pragmatic course as moderate insiders had been advocating at the start of his government.

"These elections lost a lot of their relevancy in recent weeks," says Dimitris Pantoulas, a Caracas-based political analyst. "Right now it's the economic and social situation that will determine the direction of policy."

___

AP Writers Jorge Rueda and Fabiola Sanchez contributed reporting

___

Joshua Goodman on Twitter: @APjoshgoodman