Atiku Abubakar, a retired Customs officer and Nigeria's vice president between 1999 and 2007, has been elected the presidential candidate of the Peoples Democratic Party (PDP).
At a PDP national convention in Port Harcourt, Rivers State, held Saturday and Sunday, Mr Abubakar defeated 11 other aspirants to clinch the hotly-contested ticket. His victory sets him as the main challenger to President Muhammadu Buhari in the 2019 general election.
The ruling All Progressives Congress confirmed Mr Buhari as its candidate at a non-competitive convention in Abuja, Nigeria's capital on Saturday.
Mr Abubakar, an Adamawa-born politician whose quest for Nigeria's presidency has seen him vie for the top office since 1992, polled delegates at this weekend's convention, according to party electoral chief.
His closest rival, Aminu Tambuwal, scored 693 votes while Senate President Bukola Saraki came third with 317 votes.
Sunday's PDP 2018 National Convention is one of the most competitive since 1998 when the party chose Olusegun Obasanjo as its candidate. Mr Obasanjo went on to lead Nigeria for eight years starting in 1999, with Mr Abubakar as his vice president.
Mr Abubakar left the PDP in the build up to the 2007 election to be the flag bearer of the then opposition Action Congress. He lost the election to late President Umaru Yar'Adua.
He later joined the PDP again and sought to be the party's candidate in 2011. He lost the ticket to Goodluck Jonathan who led Nigeria until 2015.
Mr Abubakar, in the build up to the 2015 election again left the PDP for the then newly formed All Progressives Congress. He came third in the APC presidential primary behind Muhammadu Buhari and Rabiu Kwankwaso. Mr Buhari went on to win the general election and is now seeking re-election.
Mr Abubakar left the APC for the PDP last year, accusing the ruling party and President Buhari of failing Nigerians.