Muhammadu Buhari has twice come to power in Nigeria — but the circumstances in each case could not be more different. Over 30 years ago, Buhari seized power in a military coup. Last week, voters in Africa's most populous country and its most vibrant economy returned him to power through the ballot box, marking the first democratic transition in governments in Nigeria's history. He must now unite a fractious country and restore the people's faith in their political system.

Buhari was a major general in the Nigerian Army when he seized power in 1983, arguing that "a flawed democracy was worse than no democracy at all." He served as head of state for 18 months, until he too was removed by military officers unhappy with his rule. Ostensibly, they acted because of Buhari's failure to tackle economic problems; many observers believe, however, that the coup was triggered by fears that Buhari's anti-corruption campaign would bring them to justice.

Buhari was detained for three years before being released and allowed to resume his political career. Declaring himself "a convert to democracy," Buhari ran three times for president, campaigning to clean up the country's politics, and losing in 2003, 2007 and 2011. This year, however, opposition parties united in the All Progressives Congress (APC) to take on President Goodluck Jonathan and the People's Democratic Party (PDP) that he heads and had been holding onto power since 1999.