Obituary: Daniel arap Moi, former Kenyan president
For more than a quarter of a century, Daniel arap Moi dominated Kenyan politics.
He was a more populist politician than his predecessor Jomo Kenyatta and won widespread support in the country.
But he failed to dismantle Kenyatta's dictatorial style of rule and ruthlessly suppressed political opponents.
He earned the sobriquet "professor of politics" but his legacy was tarnished by economic stagnation and accusations of corruption.
Moi was born on 2 September 1924 into a farming family in Baringo county, mid-western Kenya.
First named Torotich arap ("son of") he adopted the name Daniel when, as a schoolboy, he was baptised by Christian missionaries.
From teacher to education minister
He was one of the few politicians in Kenya who belonged to neither of the main ethnic groups - Kikuyu and Luo. He was a Tugen, a member of one of the smallest tribal groupings in Kenya, the Kalenjin.
He became a teacher at the Government African School in 1945, advancing to head teacher the following year at the age of 22.
After two other moves he returned to Kapsabet in 1954 as a headmaster, where he remained until 1957.
He played no part in the Mau Mau rebellion but was sympathetic to the movement to gain independence from the UK and, at the height of the uprising, he sheltered five Mau Mau rebels on his farm for several weeks.
In March 1957 Moi was one of the first eight black people to be elected to the Legislative Council.
Early in 1960 he was one of the African delegates to the Lancaster House conference in London, which drafted a new Kenyan constitution granting black people a majority in the Legislative Council.
In 1961 he became minister of education and, in a coalition council of ministers, formed of Kanu (Kenya African Nationalist Union) and Kadu (Kenya African Democratic Union - Moi's party), he was named minister for local government.
During this time he took part in the series of conferences preparing Kenya for independence and ensured that the new government would be a federal system providing regional autonomy, to protect the minorities.
When Kenya finally gained independence in December 1963 and Kenyatta became prime minister, Moi was designated shadow minister of agriculture.
Kadu's fortunes declined and it was dissolved with most of its leaders, including Moi, joining the ruling Kanu.
At the end of the following year, when Kenyatta became president, Moi was sworn in as minister for home affairs.
This was an important post as it made him head of Kenya's national police and charged him with the responsibility for maintaining national security.
While retaining this post, in January 1967 he was appointed Kenya's vice-president and vice-chairman of the Kanu parliamentary group.
During his period of office as home affairs minister most foreign observers agreed that Kenya had far fewer political prisoners and less internal repression than almost any other African country in the post-colonial period.
Air force disbanded
When Kenyatta died in August 1978, Moi immediately became interim president and from the outset he made it clear that he would keep the country on the same pro-Western course.
In October that year he was elected unanimously head of Kenya's only political party and became the country's second president.
After the elections the following November, he carried out a restructuring of the government. The reshuffle was the biggest since 1963 and an attempt to strengthen a position hampered by the system he had inherited.
New ministries, such as natural resources and the environment, were brought in, and other ministries, such as agriculture, were split up.
In August 1982 there was an attempted coup to oust him but it was crushed by loyal sections of the armed forces.
Later that month the president disbanded the air force, members of which had led the coup.
More political prisoners
The incident gave Moi the opportunity to consolidate his power by expelling those behind the plot from government and by ushering in a one-party state by way of changing the constitution.
Those groups that opposed this move were repressed.
With the ending of the Cold War, Kenya's strategic position as a counter to communist influences in Ethiopia and Tanzania grew less important.
The feelings of certainty that the stability of his regime once engendered gave way to increasing unease at the repression his government was showing towards his political opponents.
The number of political prisoners grew and Moi's government took measures to limit press freedom.
In the 1990s, hundreds of thousands of people - especially from the Rift Valley province - were displaced and hundreds were reported to have been killed in ethnic clashes, most of them belonging to opposition groups.
Aid, so readily given in the past, was withheld to encourage economic, social and political reforms.
Of these, the restoration of multi-party democracy was a priority. Moi succeeded in bringing this about and, by skilfully exploiting Kenya's tribal divisions, won elections in 1992 and 1997.
But Moi's rule was typified by economic stagnation and his government was so corrupt that the International Monetary Fund (IMF) and the World Bank stopped lending to Kenya.
The biggest single scandal was first made public in 1992.
Known as the Goldenberg affair, it centred on the theft of £400m of public money that was paid as state subsidies to a company called Goldenberg International to promote fictitious exports of Kenyan gold and diamonds.
It took 14 years for fraud charges to be brought against, among others, the company's director, the former treasury permanent secretary and the former deputy director of the central bank.
An official inquiry suggested that President Moi must have known about what was going on but he always denied involvement and was never charged.
At the 2002 elections, from which Moi was constitutionally barred, he was a target of derision and his car pelted with mud.
His Kanu party was routed. At the ceremony in which he handed over power to Mwai Kibaki, the crowd was openly hostile to Moi.
In 2007 then-President Kibaki appointed him as the Kenyan envoy to Sudan because of his "vast experience and knowledge of African affairs and his stature as an elder statesman".
Moi spent his final years in retirement, isolated from the political establishment.