Presidential campaigns and elections
2003 presidential election
In 2003, Buhari ran for the office of the president as the candidate of the All Nigeria People's Party (ANPP). He was defeated by the People's Democratic Party incumbent, President Olusẹgun Ọbasanjọ, by more than 11 million votes.
On 18 December 2006, Buhari was nominated as the consensus candidate of the All Nigeria People's Party. His main challenger in the April 2007 polls was the ruling PDP candidate, Umaru Yar'Adua, who hailed from the same home state of Katsina. Buhari officially took 18% of the vote to Yar'Adua's 70%, but Buhari rejected these results. After Yar'Adua took office, he called for a government of national unity to bring on board aggrieved opposition members. The ANPP joined the government with appointment of its national chairman as a member of Yar'Adua's cabinet, but Buhari denounced this agreement.
In March 2010, Buhari left the ANPP for the Congress for Progressive Change (CPC), a party he had helped to found. He said that he had supported foundation of the CPC "as a solution to the debilitating, ethical and ideological conflicts in my former party the ANPP".
Buhari was the CPC presidential candidate in the 2011 election, running against incumbent President Goodluck Jonathan of the People's Democratic Party (PDP), Mallam Nuhu Ribadu of Action Congress of Nigeria (ACN), and Ibrahim Shekarau of ANPP. They were the major contenders among 20 candidates. Buhari campaigned on an anti-corruption platform and pledged to remove immunity protections from government officials. He also gave support to enforcement of Sharia law in Nigeria's northern states, which had previously caused him political difficulties among Christian voters in the country's south.
The elections were marred by widespread sectarian violence, which claimed the lives of 800 people across the country, as Buhari's supporters attacked Christian settlements in the country's central region. The three-day uprising was blamed in part on Buhari's inflammatory comments. In spite of assurances from Human Rights Watch, which had judged the elections "among the fairest in Nigeria's history", Buhari claimed that the vote was flawed and warned that "If what happened in 2011 should again happen in 2015, by the grace of God, the dog and the baboon would all be soaked in blood".
Buhari remained a "folk hero" to some for his vocal opposition to corruption. He won 12,214,853 votes, coming in second to Jonathan, who polled 22,495,187 votes and was declared the winner.
Buhari ran in the 2015 presidential election as a candidate of the All Progressives Congress party. His platform was built around his image as a staunch anti-corruption fighter and his incorruptible and honest reputation, but he said he would not probe past corrupt leaders and would give officials who stole in the past amnesty if they repented.
In the runup to the 2015 election, Jonathan's campaign asked that Buhari be disqualified from the election, claiming that he was in breach of the Constitution. According to the fundamental document, in order to qualify for election to the office of the president, a person must be "educated up to at least School certificate level or its equivalent". Buhari failed to submit any such evidence, claiming that he lost the original copies of his diplomas when his house was raided following his overthrow from power in 1985.
In May 2014, in the wake of the Chibok schoolgirls kidnapping, Buhari strongly denounced the Boko Haram insurgency. He "urged Nigerians to put aside religion, politics and all other divisions to crush the insurgency he said is fanned by mindless bigots masquerading as Muslims". In July 2014, Buhari escaped a bomb attack on his life by Boko Haram in Kaduna; 82 people were killed. In December 2014, Buhari pledged to enhance security in Nigeria if elected president. After this announcement, Buhari's approval ratings skyrocketed, largely due to Jonathan's apparent inability to fight Boko Haram. Buhari made internal security and wiping out the militant group one of the key pillars of his campaign. In January 2015, the insurgent group "The Movement for the Emancipation of the Niger Delta" (MEND) endorsed Buhari.
In February 2015, former Nigerian President Olusegun Obasanjo quit the ruling PDP party and endorsed Buhari.
On 31 March, Jonathan called Buhari to concede and congratulate him on his election as president. Buhari was sworn in on 29 May 2015 in a ceremony attended by at least 23 heads of state and government.