Botswana President Seretse Khama, 59, who ruled his country since its independence from Great Britain in 1966, died of cancer today in his official residence in the capital city of Gaborone.

Vice President Quett Masire took over presidential duties for the transition period until an election to choose President Khama's successor can be held. The transfer of power is not expected to significantly after Botaswana's domestic or foreign policies.

A lawyer with a degree from Oxford University, President Khama belonged to the first generatin of post-independence African leaders. Like Jomo Kenyatta of Kenya, he pursued pro-Western, capitalit policies. In the 14 years of stability the France-sized country has had since independence, a nonracial, parliamentary democracy has taken root.

In a region of tribal and racial conflict, Botswana became an inland atoll of tranquillity and steady economic development. The country has no political prisoners, is relatively free of official corruption, has three political parties and has held four general elections since 1966.

It still does not arm its police force and only after Botswana was threatened with involvement in the Zimbabew guerrilla war in a few years ago did President Khama alloy the creationof a 2,000-man defense force.

President Khama was one of the five "front-line" African presidents, often counseling moderation and negotiation, who helped the United States and Great Britain in their efforts to obtain a peaceful settlement of the Zimbabwe war.

President Khama's personal popularity and position as hereditary leader of the country's largest tribal group, the Bamangwato, were an important factor in Botswana's success.

Born July 1, 1921, at Serowe, he was the grandson of "Khama the Great" who asked for neutral status under Great Britain's Queen Victoria, a request that led to the creation of the Bechuanaland Protectorate, now Botswana.

After attending South Africa's Fort Hare University, alma mater of several black leaders, including Zimbabwe's Robert Nugabe, President Khama went to Oxford University to study.

A dignified, soft-spoken man, in 1948 he married a white English woman, Ruth Williams, then a typist at the Lloyds of London insurance company. The marriage, which has produced four children, caused a scandal at the time and provoked the British colonial government to banish President Khama from his homeland for six years.

In 1956 President Khama was permitted to return to the British protectorate from his exile in a London suburb. Six years later he launched the Bechuanaland Democratic Party, which won 23 of 31 seats in the legislative assembly elections of 1965, the protectorate's first balloting under universal suffrage. President Khama then became the country's first prime minister. He told an interviewer at the time that "Our policy is moderation without bitterness. Ours is a multiracial country where all men will work together."

Queen Elizabeth knighted the Botswana leader a few days before the country gained independence and he became its first president.

Another reason for Botswana's relatively conflict-free politics is the tribal cohesion of the population. President Khama's Bamangwato tribe comprises about 80 percent of the 800,000 Botswannans. The minority groups have never been strong enough to challenge President Khama's Botswana Democratic Party's hold over the National Assembly, where it now controls 29 of the 32 seats.

President Khama's pragmatic approach to the problem of relations with his powerful neighbor South Africa, a dilemma Magabe's new administration is now grappling with, also has contributed to Botswana's stability. He has avoided public criticism of apartheld and has been cautious in his assistance to armed guerrillas fighting Pretoria. He has refused them bases and only reluctantly allows them limited infiltration rights through Botswana to South Africa.

However, the country has been generous in its acceptance of both black and white refugees from South Africa, especially in 1976 when thousands of youths fled the country after the violent upheavals in black townships.

Economically, Botswana already is a de facto member of the economic "constellation of states" South Africa would like to establish in the region. "It belongs to the Sough African-run customs union, which also includes Lesotho and Swaziland. It gets 85 percent of its imports and all of its oil through South Africa and it allows both small- and large-scale investment in Botswana by South Africians.

In addition, between 30,000 and 10,000 Botswanana work in the mines of South Africa.

Harry Oppenheimer's diamond conglomerate, De Beers Consolidated, runs Botswana's two diamond mines at Orapa and Jwaneng and Botswana is one of the top world producers of the gem. This mineral wealth and cattle ranching -- an activity that reportedly made President Khama a millionaire -- are the backbone of the country's economy.

Acceptance of ties with South Africa and President Khama's stress on "do it yourself" to his own people have helped give Botswana an average annual growth rate of 15 percent over the last eight years while its currency, the pula, has gained steadily in strength.

Pro-Western policies and a sound, modest spending policy geared towards rural development have also brought the economy the added fillip of substantial Western economic aid.

President Khama has not been complacent about the relationship with South Africa, a dependency that could become an increasing liability for Botswana as the struggle for power between black and white nationlisms grows in South Africa. Not only does such a connection limit the support Botswana can extend to black dissidents in South Africa, but it also means that in the event of sanctions against Pretoria, Botswana would suffer as well.

President Khama has therefore been a leading force behind moves to foster closer economic cooperation among the region's black-ruled states in order to minimize the South African connection.