His plane touched down around 4:35 pm (1535 GMT) at the international airport in Abuja, an AFP correspondent said.
Wearing a black caftan with a cap to match, the 74-year-old left the aircraft unaided and was met by Vice President Yemi Osinbajo and other senior government officials, including ministers, security chiefs and state governors.
He took a salute to the military guard of honour before he was driven in a convoy to the presidential villa.
An enthusiastic crowd of supporters were at the airport and lined the roads to welcome Buhari back.
He is set to address Nigerians on Monday morning, the presidency said.
The president left for the British capital on May 7 with his prolonged absence causing tensions back home, where calls have grown for him to either return or resign.
Buhari, a retired general who headed a military regime in the 1980s, has been dogged by speculation about his health since June last year when he first went to London for treatment of what his aides said was a persistent ear infection.
He then spent nearly two months in London in January and February and said on his return in early March that he had “never been so ill”.
In July, members of the ruling party and the opposition went to see him in London and even took pictures in an attempt to douse public anxiety.
The health of Nigeria’s leaders has been a sensitive issue since the 2010 death in office of president Umaru Musa Yar’Adua after months of treatment abroad.
Buhari’s main opponents in the 2015 election that brought him to power claimed he had prostate cancer. He denied it.
Since August 7, there has been a series of protests in Abuja demanding that Buhari return or quit if he is incapacitated.
The rallies turned violent on Tuesday when mainly ethnic Hausa traders pelted protesters with stones, prompting them to abandon their daily vigils.
Deji Adeyanju, one of the protest organisers, told AFP on Saturday he was excited at the news of Buhari’s return.
“We are happy that the president is coming back today because we have been vindicated,” he said.
“We organised the rallies to make him come back so that he can continue to carry out the mandate on which he was elected in 2015.”
Adeyanju said a planned protest in Lagos on Monday has now been cancelled.
“There is no more demonstration as the president has acceded to our demand,” he said, warning however that protesters would “maintain close vigilance” of the government and urging Buhari to tackle rising insecurity, including the Boko Haram insurgency and militancy in the Niger delta.
“More importantly, the president has to end mass poverty in the land and the fight against corruption has to be given a push,” he added.
Dapo Thomas, a politics lecturer at Lagos university, said Buhari’s return would boost the central government’s clout.
“Every policy, every decision, every project will now have a stamp of authority and legitimacy,” he said, adding that the anti-graft campaign would also be stepped up.
“Buhari’s selling point is his integrity. He is very passionate about eradicating corruption from Nigeria and I think his return will re-invigorate the campaign,” he said.
Buhari has been struggling to rid Nigeria of the endemic corruption that has blighted its development and helped tip the country into recession.
High-profile members of the previous government have been arrested on corruption charges, sparking accusations of a political witch hunt — claims the current administration denies.