Although the Cape of Good Hope was first circumnavigated in 1488 by Bartolomeu Dias and later (1497) by Vasco da Gama, the first European settlement of the region was only in 1652, when Jan van Riebeeck founded a resupply station for the Dutch East India Company on Table Bay; the station subsequently became Cape Town. At the time of Van Riebeeck's landing, Cape Province was inhabited by San (Bushmen) and Khoikhoi (Hottentots) in the southern and central areas, and by Bantu speakers on the northern and eastern fringes (see Bantu languages). The Dutch East India Company brought Dutch settlers to Cape Town, who farmed and raised livestock and were called Boers [Du., = farmers]. In 1689, French Huguenots began to arrive; they developed the wine industry. The company ruled the Cape until 1795, except for a brief period (1781–84) of French occupation. In 1779 the first of numerous frontier wars (continuing until 1877) between Europeans and the Xhosa (a Bantu-speaking people) erupted. These Xhosa Wars were mainly over land and cattle.
During the French Revolutionary and Napoleonic wars (1792–1815), Britain occupied the Cape from 1795 to 1803, when the Dutch regained control; Holland formally ceded it to Great Britain in 1806. The British named the territory Cape of Good Hope Colony and encouraged immigration from England. The new British settlers soon conflicted with the Boers over anglicization of the courts, control of farm- and pastureland, and slaveholding. Beginning in 1835 many Boers left Cape Colony (see Trek, Great), seeking more land and escape from British rule. The Boers founded a temporary republic in Natal (see KwaZulu-Natal) and longer-lasting republics in the Transvaal and Orange Free State (see Free State).
In 1850, Cape Colony had about 140,000 residents of European descent. In 1853 the colony was allowed to elect a legislature to advise the governor, and in 1872 it received internal self-government. In 1867 diamonds were discovered in the Kimberley region, which in 1880 was annexed by the Cape. The British and the remaining Boers generally cooperated until the 1890s, when the British, and especially Cecil Rhodes (then prime minister of Cape Colony), sought to unite the Transvaal and the Orange Free State with the Cape and Natal. In 1895–96, L. S. Jameson staged an unsuccessful raid from Cape Colony into the Transvaal, which greatly increased tension between Britons and Boers. The South African War (1899–1902) followed soon thereafter. In 1910 the Cape Colony joined with Natal, the Transvaal, and the Orange Free State to become a founding province of the Union (now Republic) of South Africa.