Opposition led by intellectuals arose. But Mr. Moi, who also controlled the news media and the police and military services, and whose pronouncements had the force of law, closed the universities and suppressed his opponents with detentions, torture and killings, according to United Nations investigators and human rights organizations, including Amnesty International and Africa Watch.

Official corruption, abuse of power and a deteriorating economy exploded in 1982 in an attempted coup by low-ranking air force officers. But army loyalists crushed the uprising, and Mr. Moi ordered the arrest of the entire 2,100-member air force. Hundreds were imprisoned or executed, and the service’s ranks were replaced. He also ordered all civil servants to join the ruling political party, of which he was president.

Despite Western military and economic aid and income from tourists drawn to Kenya’s game preserves, the economy lagged for most of Mr. Moi’s tenure, mired in corruption that affected all manner of transactions, from cab rides and the delivery of goods and services to bribery and kickbacks in public and private dealings.

Investigations after Mr. Moi stepped down found that his government had lined the pockets of his family and its allies with as much as $4 billion. The biggest fraud in Kenya’s history, the Goldenberg affair, in which the central bank paid incentives to a company for exporting gold, diamonds and jewelry that did not exist, cost taxpayers billions and sent Kenya’s economy into a tailspin in the early 1990s.

When he was still vice president, Mr. Moi met President Jimmy Carter at the White House in 1978, and after becoming president he met President Ronald Reagan there in 1981 and 1987 (when he also met Prime Minister Margaret Thatcher in London). But after the Cold War, the West no longer regarded Kenya as a strategic outpost, and Mr. Moi was increasingly seen as a despot.

Constitutionally barred from running in the 2002 elections, he agreed to give up power in a smooth transfer that was then still rare in Africa. He supported a son of Jomo Kenyatta, but Mwai Kibaki, who had lost to Mr. Moi in 1992 and 1997, and who was nearly killed in a traffic accident during the campaign, won the presidency by a 2-to-1 margin. Mr. Moi later supported his old opponent’s re-election.

As Mr. Moi retired, his successors found even more corruption and human rights abuses than had been suspected. A 2003 inquiry exposed torture cells at Nyayo House in Nairobi, a government building where dungeons yielded evidence supporting the accounts of victims.