Lagos - President Goodluck Jonathan's party has finished second in a state election seen as a test of his popularity and opposition strength, the country's electoral watchdog said on Sunday.
The Independent National Electoral Commission (INEC) said on its website that Jonathan's Peoples Democratic Party (PDP) received 97 700 votes in the race for a new governor in southeastern Anambra state, while the main opposition All Progressives Congress (APC) was just behind with 95 963.
Victory went to the All Progressive Grand Alliance which retained the governorship with 180 178 votes, INEC said of the election that concluded on Saturday.
Voting in Anambra was being watched to determine the extent of public support for Jonathan before his expected run for re-election in 2015.
He has not yet declared his candidacy but some within his party believe that he should uphold an unwritten rule that the presidency rotates between a candidate from the majority Muslim north and the predominantly Christian south.
Jonathan is a southern Christian from Bayelsa state.
Five state governors who had previously formed a splinter group in opposition to Jonathan's expected bid for re-election last week announced that they had joined the APC.
The APC is looking to secure its first presidential victory since Nigeria returned to civilian rule in 1999.
Jonathan congratulated the APGA's candidate, Willie Obiano, on his victory, calling on him in a statement to "dedicate himself to building on the laudable achievements of his illustrious predecessor, Mr. Peter Obi".
Obi is seen as a Jonathan ally and APGA support could be crucial to the ruling party's chances of retaining power in 2015, with the PDP controlling 18 states nationwide to the APC's 16 after last week's defections.
Polling in Anambra first took place on November 16 but the PDP, APC and Labour Party all called for the election to be declared null and void, amid reports that ballot boxes, papers and other election material went missing.
Police also imposed tough restrictions on movement into and out of the state, which was viewed in some quarters as harassment and intimidation and raised fears for the running of the general election in 18 months' time.
INEC, which admitted there were some "lapses" in organisation, ordered a partial re-run in a number of constituencies on Saturday.
Turnout for the whole exercise was low at just 26.3 percent.