Kenya’s former President Daniel arap Moi has died at the age of 95.

President Uhuru Kenyatta announced his death, saying the nation had lost a “great man”.

Mr Moi was Kenya’s longest-serving president. He was in office for 24 years, until intense pressure forced him to step down in 2002.

His critics saw him as an authoritarian ruler who oversaw rampant corruption, but his allies credited him for maintaining stability in the country.

In 2004, Mr Moi asked for forgiveness from “those he had wronged”.

President Kenyatta has declared a period of mourning, including the flying of flags at half-mast, until a state funeral is held for Mr Moi. No date has been set for the funeral.

Mr Kenyatta said the continent was “immensely blessed by the dedication” of the late president, who spent “almost his entire adult life serving Kenya and Africa”.

Uganda’s President Yoweri Museveni said Mr Moi was a “true pan-Africanist”, while Tanzania’s President John Magufuli said he would be remembered for promoting regional integration.

Kenya’s former Prime Minister Raila Odinga, who was detained by the Moi regime for campaigning for multi-party democracy, praised him for introducing “incremental” reforms said that in retirement the former president had “conducted himself with complete dignity befitting an elder statesman”.

On Twitter, some Kenyans were less forgiving:

Others praised Mr Moi for his focus on improving the health of schoolchildren.

In the 1980s and 1990s, the ministry of education distributed free packets of milk to all primary schools, targeting children under the age of 13.