Muhammadu Buhari to contest Nigeria election for APC
Former military leader Muhammadu Buhari is set to contest Nigeria's presidential election after winning a primary for the opposition APC.
He will challenge President Goodluck Jonathan - a repeat of the 2011 poll.
The elections in February look to be the closest fought since the end of military rule in 1999.
The 71-year-old former general, a Muslim from the north, seized power in 1983 but was himself deposed in a coup less than two years later.
He was up against four other candidates in the vote at the All Progressives Congress (APC) party convention in Lagos.
In the previous election, Mr Jonathan defeated Mr Buhari, with almost 59% of the vote against 32%, sparking widespread unrest in northern areas which backed Mr Buhari.
More than 500 people were killed and thousands of people were forced from their homes.
Analysis: Will Ross, BBC News, Lagos
The governing People's Democratic Party (PDP) has gone for continuity with President Goodluck Jonathan and the current Vice President, Namadi Sambo as his running mate.
The APC's chosen candidate, Muhammadu Buhari, says the last thing Nigeria needs right now is continuity and he is promising to tackle the country's insecurity, corruption and economic worries.
The former military ruler has been out of power for close to 30 years and although popular, especially in northern Nigeria, there is little evidence to prove he has what it takes to fix the country.
In Nigeria the running mate is an important part of the team and can help bring in the votes.
But given the country's regional tensions, the APC needs someone from the south with a track record.
The outgoing governor of Lagos State, Babatunde Fashola, has earned plenty of respect for his reforms in the commercial capital.
As he is a Muslim, like Buhari, this option may not be acceptable even though religion has never been an issue during his tenure in Lagos.
Boko Haram insurgency
Mr Buhari won 3,430 votes while his closest rival, former Vice-President Atiku Abubakar, fell far short, with only 954 votes out of 8,000.
Mr Abubakar congratulated his opponent on Twitter after the vote and said: "The delegates have spoken, you fully deserve the victory."
This will be the fourth time Mr Buhari contests a presidential election - he is yet to win.
The BBC's Will Ross in Lagos says that this election is likely to be a tight race, especially if the opposition manages to stay united behind one candidate.
Whoever wins the presidency will need to deal with a growing jihadist insurgency in the north and an economy under strain due to the falling oil price.
President Jonathan was the sole candidate at the ruling PDP's primaries, also on Thursday.
He told his party members that "today we are stronger, bigger and more in tune with the yearnings of our people".
Mr Jonathan has faced mounting criticism over his handling of the Boko Haram insurgency.
Supporters of Mr Buhari believe that as a former army general, he is better placed to combat the militants.
Mr Buhari's 20-month tenure as military ruler is remembered for a strict campaign against indiscipline and corruption, as well as allegations of human rights abuses.