Defeated in the last three elections, he achieved a historic victory in the 28 March election, becoming the first opposition candidate to defeat an incumbent.
The verdict on Mr Buhari's 20 months as military ruler is mixed.
About 500 politicians, officials and businessmen were jailed as part of a campaign against waste and corruption.
Some saw this as the heavy-handed repression of military rule.
But others remember it as a praiseworthy attempt to fight the endemic graft that prevented Nigeria's development.
He retains a rare reputation for honesty among Nigeria's politicians, both military and civilian, largely because of this campaign.
As part of his "War Against Indiscipline", he ordered Nigerians to form neat queues at bus stops, under the sharp eyes of whip-wielding soldiers.
Civil servants who were late for work were publicly humiliated by being forced to do frog jumps.
The opposition has united this time to back one candidate to challenge the PDP in the presidential poll
He also introduced a notorious decree to restrict press freedom, under which two journalists were jailed.
However, his attempts to re-balance public finances by curbing imports led to many job losses and the closure of businesses.
As part of anti-corruption measures, he also ordered that the currency be replaced - the colour of the naira notes were changed - forcing all holders of old notes to exchange them at banks within a limited period.
Prices rose while living standards fell, leading to a palace coup by Gen Ibrahim Babangida on 27 August 1985. Mr Buhari was imprisoned for 40 months.
Mr Babangida wanted to speed up the restoration of civilian rule, which Mr Buhari did not see as a priority.