Officials refused to disclose what he was being treated for.
It was the president's second spell of medical leave this year - leading many Nigerians to question whether he was well enough to run the country.
President Buhari, 74, walked unaided from the plane after landing in the Nigerian capital, Abuja.
He was greeted by Vice President Yemi Osinbajo, who has acted as interim leader, and was accorded a military salute.
He made no statement and immediately travelled to the presidential villa.
The president was greeted by Vice President Yemi Osinbajo
President Buhari, who took office in May 2015, handed over power to Vice President Osinbajo to allay concerns of a void at the helm of Africa's biggest economy.
His absence sparked numerous protests, including demands that he should resign, as well as calls for more transparency about the president's condition.
There has been speculation about his health since June 2016, when he first went to London for treatment of what his aides said was a persistent ear infection.
His spokesman said he will address Nigerians on Monday morning.