ABUJA, Nigeria - As Nigerians celebrated the electrifying victory Wednesday that returned one of its harshest former dictators to power, sobering challenges confront Muhammadu Buhari, from an Islamic insurgency that has killed thousands to widespread poverty and graft.

The 72-year-old Buhari made history as the first opposition party candidate to win elections in Africa's most populous nation, ending President Goodluck Jonathan's bid for another term. For a former general who three decades ago led Nigeria following a coup, it was an amazing transformation to a democratically elected president.

Fresh from his victory, Buhari warned the country's brutal Boko Haram insurgents that he would be coming after them.

"Boko Haram will soon know the strength of our will and commitment to rid this nation of terror," he said Wednesday as he received a certificate attesting to his victory. "We shall spare no effort until we defeat terrorism."

The bespectacled president-elect also warned that corruption would not be tolerated after he takes office May 29.

As Nigeria's leader three decades ago, he returned looted state assets to government coffers, but his so-called "war against indiscipline" also sent soldiers into the streets with whips to enforce traffic laws and imposed humiliating punishment on tardy civil servants. His regime executed drug dealers, jailed journalists critical of the government, and passed laws that allowed indefinite detention without trial.

Buhari, who insists he has undergone radical change since then and now embraces democracy, pledged Wednesday to take on the twin scourges of corruption and an Islamic uprising he said has "challenged Nigeria to its limits."

"Corruption attacks and seeks to destroy our national institutions and character ... distorts the economy and creates a class of unjustly enriched people," Buhari said, wearing splendid white robes with gold embroidery. "Such an illegal yet powerful force soon comes to undermine democracy because it has amassed so much money that they believe they can buy government."