Although they comprise only a small part of the population today, the area that is now Botswana was originally, for many thousands of years, inhabited by the semi-nomadic hunter-gatherer Bushman people. They are known locally as the Basarwa, and are related to the pastoralist Khoikhoi.
Archaeological evidence, gathered from tools made of wood, bone and stone unearthed at Tsodilo Hills in the north-west, suggests continuous occupation by the Khoikhoi and the Bushmen from C. 17 000 BC to C. AD 1650.
Bantu-speaking settlers from the north began moving into surrounding territories before the first millennium was out, bringing with them an Iron Age farming culture based on the raising of cattle and cultivation of grain crops.
They began migrating into present-day Botswana, slowly replacing the nomadic and pastoral Khoikhoi and Bushmen in many areas. Evidence of their influence can be found in the northern regions with the remains of small beehive-shaped grass-mat houses (c. AD 420) that were used by these farmers.
There is also evidence west of the Okavango River, alongside the Khoikhoi and Bushman sites in Tsodilo Hills, of similar farming settlements. From around the same period, there is evidence of an Iron Age iron-smelting furnace, dated c. AD 190 in Tswapong Hills, near Palapye.
During the ensuing centuries, the tendency of different chiefs and their followers to leave main groups and settle in other areas resulted in the settlement patterns of the region's modern people. The first to arrive were the Zhizo, thought to be the ancestors of the Bakalanga. They were a non-Setswana-speaking group of Bantu who came from present-day Zimbabwe and settled in the north-east, around Francistown.
During this century three Setswana- speaking brothers split from their family group, forming the beginnings of three prominent Setswana-speaking groups of today. The Bakwena settled in the Mole-polole area, the Bangwaketse in the Kanye district and the Bangwato around Serowe.
The Bangwato split, with Chief Khama I remaining in Serowe, while his brother Tawana moved north to establish the Batawana clan around Lake Ngami and the southern fringes of the Okavango Delta. Other non-Setswana-speaking people arrived during the late 1700s, mostly from the north. The Bayei, Mbukushu and Basubiya splintered from the Balozi Kingdom in present-day Zambia and settled the northern regions, along the Linyanti, Chobe and Okavango rivers.
As the ivory, cattle and slave trade spread inland from the Cape Colony and the coasts of Mozambique and Angola, the whole area experienced increasingly unsettled times. The Boer trekkers from the Transvaal were involved in various cattle and land wars with the local people, and great instability and militancy in Zululand - known as the period of the Difaqane (exodus) - forced many more groups to move into what is now Botswana, in search of land and peace.
The Barolong and Balete came from the south and the Bakgatla and Batlokwa from the south-east during the early to mid 1800s. Zulu raiding parties under the control of Mzilikazi won control over large areas held by the Bangwato and Bangwaketse, forcing families deeper into the Kalahari.
Christian missionaries began to establish their influence in the early 1800s, with Robert Moffat the first to arrive. David Livingstone followed in 1841, before establishing the first school in the country. From 1829 to 1892 the Tswana king of the Bakwena, Sechele, ruled around Molepolole and allied himself with British traders and missionaries, eventually being baptised by David Livingstone.
By the late 1870s the Bangwato, the largest Tswana nation, had taken control of Kwena under the chiefdom of Khama III, who ruled from 1872 to 1923.
As a result of Boer expansionism, and to a lesser extent continuing Ndebele incursions from the north-west, Botswana came under British protection in 1885.
The Berlin Conference defined the boundaries of present-day Botswana, and a British protectorate was formally declared over the area then called Bechuanaland. The administrative capital was Mafikeng, which was in the adjoining Cape Colony outside the territory's borders. At one stage the protectorate fell under the control of the Cape Colony.
Chief Sekgoma, head of the Batawana, ceded Ghanzi to the British government to allow white settlement to take place within the central regions around the town of Ghanzi. In return the British gave sovereignty of Ngamiland to the Batawana.
The last of the present-day Botswanan groups to settle in the country were the Mbanderu and the Baherero, who fled the German occupation of what is now Namibia in the early 1900s and established their livestock-based lifestyle along the western and southern reaches of the Okavango.
Since the three chiefs (of the Bakwena, Bangwaketse and Bangwato) had been promised by the British, Bechuanaland was excluded from the country established with the formation of the Union of South Africa in 1910.
Khama III was one of the chiefs involved in the agreement resulting in the protectorate. Under his rule, peace and stability returned to the land and his people, the Bangwato, became a leading force in Bechuanaland. On his death in 1923 he was succeeded by his son, Sekgoma, who died two years later. As Sekgoma's eldest son, Seretse, was still only a child, his older half-brother, Tshekedi, ruled in his place.
It was during this period that Seretse travelled to England for his schooling and tertiary education, and it was there that he met and married Ruth Williams, a white woman, in 1948. The marriage split his people back home: Tshekedi, a strict traditionalist, was particularly strongly opposed to the inter-racial union. Because of the dispute, the British banned both Khama and Tshekedi from Botswanan tribal lands.
1956: Khama was eventually allowed to return with his wife in 1956, but only as a private citizen, as he had been persuaded to renounce his claim to the Bangwato chieftainship.
During the 1980s and 1990s South Africa was involved in ongoing internal conflict, and between 1984 and 1990 Botswana suffered at the hands of the South African army, because of guerrilla fighters seeking refuge in the country. In 1985, 12 people were killed during a South African military raid into Gaborone.
Twenty years after independence, Gaborone attained city status.
Ketumile Masire retired as president in 1998 and was succeeded by the vice president Festus Mogae, after he won the election in October 1999. Ian Khama, the son of Sir Seretse Khama, is the current vice president.