Nigeria’s President Muhammadu Buhari. (File Picture: Reuters)

Nigerian President Muhammadu Buhari thanked German Chancellor Angela Merkel for her role in alleviating the refugee crisis when he addressed the UN General Assembly on Tuesday - his first public appearance in months due to ill health.

Buhari's speech to UN leaders in New York was the first time the 74-year-old leader had appeared publicly after spending three months in London to receive medical treatment for an undisclosed condition.

Buhari thanked the UN for its role in helping to settle thousands of civilians caught up in the conflicts in Syria, Iraq and Afghanistan.

"In particular, we must collectively thank the government of the Federal Republic of Germany under the commendable leadership of Chancellor Angela Merkel and the governments of Italy, Greece and Turkey for assisting hundreds of thousands of refugees," Buhari said.

Buhari returned to Abuja from London on August 19 and has rarely been seen in public. Speculation over the president's health has led many Nigerians to demand that Buhari reveal the state of his health or step down.

It is unclear when Buhari will return to Nigeria, but he "will transit through London on his way back," presidential spokesman Femi Adesina said in a statement.