San (Bushmen) were the aboriginal inhabitants of what is now Botswana, but they constitute only a small portion of the population today. The Tswana supplanted the San, who remained as subjects. Beginning in the 1820s, the region was disrupted by the expansion of the Zulu and their offshoot, the Ndebele. However, Khama II, chief of the Ngwato (the largest Tswana nation), curbed the depredations of the Ndebele and established a fairly unified state.
A new threat arose in the late 19th cent. with the incursion of Boers (Afrikaners) from neighboring Transvaal. After gold was discovered in the region in 1867, the Transvaal government sought to annex parts of Botswana. Although the British forbade annexation, the Boers continued to encroach on native lands during the 1870s and 80s. German colonial expansion in South West Africa (Namibia) caused the British to reexamine their policies, and, urged on by Khama III, they established (1884–85) a protectorate called Bechuanaland. The southern part of the area was incorporated into Cape Colony in 1895. Until 1965, Bechuanaland was administered by a resident commissioner at Mafeking (now Mahikeng), in South Africa, who was responsible to the British high commissioner for South Africa.
Britain provided for the eventual transfer of Bechuanaland to the Union of South Africa; in succeeding years, however, South Africa's attempts at annexation were countered by British insistence that Bechuanaland's inhabitants first be consulted. The rise of the National party in South Africa in 1948 and its pursuit of apartheid turned British opinion against the incorporation of Bechuanaland into South Africa. Although Bechuanaland spawned no nationalist movement, Britain granted it internal self-government in 1965 and full independence as Botswana on Sept. 30, 1966. Shortly after, Botswana became a member of the United Nations. Seretse Khama, grandson of Khama III, was elected the first president, and served until his death in 1980, when he was succeeded by Dr. Quett Ketumile Joni Masire.
In the period after independence, the country generally maintained close ties with its white-ruled neighbors and refused to let its territory harbor guerrilla operations against them. Prior to Zimbabwe's independence in 1980, however, Botswana became a refuge for guerrillas. In the years before a multiracial government was established in South Africa, Botswana was the target of South African reprisals.
Despite the increased importance of mining in the Botswanan economy, unemployment has been a problem since the 1970s, as subsistence farming has become less profitable and migrant workers have returned from the South African mines in search of work. By 1997, Botswana also had one of the highest rates of HIV infection (25%). On the political scene, the Botswana National Front, an organization acting on behalf of labor, had grown in popularity since independence, but elections in 1989 and 1994 again gave the ruling Botswana Democratic party (BDP) a majority in the national assembly.
President Masire resigned in 1998 and was succeeded by his vice president, Festus Gontebanye Mogae. Mogae won election to the presidency in 1999, after the BDP retained its hold on the national assembly. The BDP remained in power after the Oct., 2004, national assembly elections, and Mogae was subsequently reelected president. In Apr., 2008, Mogae resigned and was succeeded as president by Vice President Seretse Khama Ian Khama, son of Botswana's first president. Despite some unhappiness with Khama among BDP members, the party faced a divided opposition and again won the national assembly elections in Oct., 2009, and Khama was then elected to a full term.