Kenya's President Jomo Kenyatta, who was a menacing symbol of African nationalism for most of the world during the continent's struggle for independence and then became the key protector of Western political and economic interests in Kenya once he came to power, died peacefully in his sleep yesterday.

Kenyatta's death in the coastal resort of Mombassa, where he was vacationing, opens a period of intense uncertainty for Kenya, which has led East Africa in economic growth but which has not resolved its deepening political and social problems.

It also will have an impact beyond Kenya's borders, particularly in the Horn of Africa, where guerrilla conflicts on the borders of Ethiopia and Somalia have engaged the interests of the United States, the Soviet Union and Middle Eastern nations. Kenyatta has been a staunch and powerful opponent of Soviet penetration of Africa.

State Department and other specialists do not foresee any change in that orientation and other basic politics in Kenya as a result of Kenyatta's death. Yet none of his potential successors has the stature that enabled Kenyatta to enforce his will in African politics for nearly half a century.

Despite long-held fears within the large foreign community that lives in Kenya that Kenyatta's death might touch off tribal violence, the first stage of the succession occurred at 3:30 a.m. in Mombassa, was withheld for eight hours, and shops and bars soon began to close as the government appealed for calm.

Vice President Daniel Arap Moi was sworn in as acting president and will govern for the next 90 days while elections are organized to choose a successor to Kenyatta, whose precise age was unknown but who was certainly more than 80.

Moi, 57, a member of the small Kalenjin tribe, thus becomes the leading contender for the post. But he may be challenged at the nominating session of Kanu, the country's only registered political party by members of Kenyatta's Kikuya tribe, which dominates the country's economic and military organizations.

The chances for such a challenge will depend largely on whether it picks up support from Kenyatta's family, particularly from his wife Mama Ngina and his daughter Margaret, who may now become major political forces.

The theme of national unity was emphasized by the appearance of 15 other members of the cabinet at Moi's swearing-in. Moi was flanked by Kenyatta's closest personal friends, Mbiyu Koinange and James Gichuru, news agencies reported.

Although he had been failing his health for much of the past six years and had ceased running the government on a day-to-day basis, Kenyatta had not appeared to be ill. He received Kenyan ambassadors at a large reception on Monday, and appeared at a family reunion last week. The cause of death was said to be old age.

Messages of condolences poured into Nairobi from around the world. President Carter, in a statement issued in Boise, Idaho, where he is vacationing, described the Kenyan leader as "a giant in the African independence struggle" and said under this rule, "Kenya's internal development was steady and orderly."

Kenyatta was also praised by the leaders of Britain, the former colonial power in Kenya. British authorities accused Kenyatta of leading the Mau Mau rebellion in the 1950s and then jailed him for seven years, despite Kenyatta's insistence that he was engaged only in political action, not violence.

Kenyatta emerged from prison to become the country's first prime minister at independence in 1963 and president when Kenya became a republic in 1964. He said he would practice "suffering without bitterness" by putting the colonial period behind him and cooperating with the British to keep the country's economy expanding.

Helped by funds provided by Britain, he offered generous payment for farms to those white farmers who decided to leave the agriculturally rich country. Kenya also developed Africa's most sophisticated tourism industry and has become known to hundreds of millions either through Safara trips or from wild game and television series produced on its plains.

Shridath Ramphal, secretary general of the Commonwealth, said at the Commonwealth's headquarters in Londan that Kenyatta had waged a long struggle to make his country free.

"We have lost a major figure of our time, a valiant fighter for freedom and the doughty builder of a nation who, in both roles, won the respect and admiration of many throughout the world."

In Bonn, West Germany Foreign Minister Hans-Dietrich Genscher described Kenyatta as a wise and moderate statesmen who had been a model for the leaders of many other young Third World states.

"He was a tireless fighter for the freedom and independence of his own country and for the liberation of the entire African continent," Genscher said.

U.N.Secretary General Kurt Waldheim sent messages of condolence to the Kenyan government and to the South African government, which was mourning the death Monday of South African President Nicolaas Diederichs.

President Kenneth Kaunda of Zambia referred to the Kenyan president as "my elder brother." They belonged to the same generation of nationlists seeking an end to British colonial rule in Africa.

"He is one of the greatest leaders of men and a hero of the African liberation struggle," Kaunda said.

The French newspaper La Monde said Kenyatta's death opened an era of uncertainty in a country hitherto spared the tensions affecting that part of the continent.

Djibouti President Hassan Gouled said, "Africa is today in mouning because it has lost one of its most eminent and respected sons."

Black Rhodesian nationlists, generally at odds, were united in expressing sorrow at his death.

Patriotic Front leader Joshua Nkomo fighting the transitional government of Rhodesia from a base in Zambia, said Kenyatta had been the father of nationalism. Nkomo worked with Kenyatta in early pan-Africa nationalist organizations.

Elliott Gabellah, joint foreign minister in Rhodesia's transitional government, said, "Mr. Kenyatta was not only a great African nationalist but also a great statesman and force for moderation and stability on the African continent."

Bishop Abel Muzorewa, one of three nationalists heading the Rhodesian coalition government, said: "Africa has lost one of its greatest sons. All men of goodwill will miss him."

In the Hague, the Dutch government paid tribute to Kenyatta but made no comment on the death of Diederichs. Asked by reporters for comment on Diederichs' death, a Foreign Ministry spokesman said it was not usual for the ministry to issue a statement on every death of a head of state. A statement was issued only if the deceased had played an exceptional leadership role, he said.