Nigeria's governing People's Democratic Party (PDP) has chosen its candidate in next April's presidential election.
President Obasanjo is standing down after two terms
Katsina state Governor Umaru Yar'Adua - whose nomination was supported by President Olusegun Obasanjo - won the primary comfortably.
The vote followed bitter in-fighting in PDP ranks for the nomination, and the atmosphere among delegates was downcast, correspondents say.
The PDP has governed Nigeria since the end of military rule in 1999.
Several state governors and a retired general were originally among the hopefuls standing in the primary, which took place in Abuja.
But some prominent candidates, including former military ruler Gen Ibrahim Badamasi Babangida, withdrew from the race.
Most of the several thousand delegates left immediately after casting their votes, not waiting to hear the results or Mr Yar'Adua's victory speech, Reuters news agency reports.
He had been widely expected to win, enjoying the support of President Obasanjo, who is standing down after two terms.
Mr Yar'Adua is the governor of Katsina state in northern Nigeria, which he rarely leaves.
He came to prominence once it was clear he had the president's backing, says the BBC's Africa analyst Martin Plaut.
Since it was hastily formed some eight years ago, the PDP has had to cope with internal feuds that led to the exit of almost all its founding members.
Vice-President Atiku Abubakar who was a key figure in the formation of the party was recently suspended following disagreements with Mr Obasanjo and allegations of corruption which he denies.
Earlier this week, the two main opposition parties in Nigeria, the All Nigeria People's Party (ANPP) and the Action Congress (AC), agreed to form an alliance.
Presidential candidates for some 50 registered political parties are being announced in the next week.