Buhari's long absences have led some in Africa's most populous nation to call for his replacement and for the military to remind its personnel to remain loyal. In recent weeks, his office released photos of officials meeting with the rail-thin but smiling president in the hopes of reassuring people back home.

Buhari did not make any comments upon his arrival in the capital, Abuja, stepping briskly from the plane and leaving in a motorcade after a salute from the presidential guard. Nigerians, some of them singing, lined the road to the airport to welcome him.

Nigeria faces political unrest, insurgency

Attention to the president's absence had grown in recent days as he marked 100 days out of the country and as protesters for and against Buhari clashed in the capital.

Nigeria's ongoing challenges include the deadly Boko Haram insurgency, a weak economy and one of the world's worst humanitarian crises, with millions malnourished in the northeast.

Vice-President Yemi Osinbajo has been acting president during Buhari's time abroad.

Burnt out cars are seen following a suicide bomb attack in Maiduguri, Nigeria, February 18. Nigeria's ongoing challenges include the deadly Boko Haram insurgency. (Hamza Suleiman/Associated Press)

Observers have feared that political unrest could erupt in Nigeria, particularly in the predominantly Muslim north, should Buhari not finish his term in office, which ends in 2019. The previous president was a Christian from the south, as is Osinbajo.

This isn't the first time Nigeria has faced a leader's long absences. When former president Musa Yar'Adua was ill abroad for months before coming home to die in 2009, northerners blocked his southern Vice-President Goodluck Jonathan from assuming power, creating a months-long political paralysis.

Jonathan was eventually confirmed, but his subsequent successful run for election angered many Muslims, breaking an unwritten agreement that power rotates between northerners and southerners.