South African history has been dominated by the interaction and conflict of several diverse ethnic groups. The aboriginal Khoisan people have lived in the region for millennia. Most of the population, however, trace their history to immigration since. Indigenous Africans in South Africa are descendants of immigrants from further north in Africa who first entered what are now the confines of the country roughly one thousand years ago. White South Africans are descendants of later European settlers, mainly from the Netherlands and Britain. The Coloureds are descended at least in part from all of these groups, as well as from slaves from the then East Indies, and there are many South Africans of Indian and Chinese origin, descendants of labourers who arrived in the nineteenth and early twentieth centuries. The history South Africa is taken here more broadly to cover the history not only of the current South African state but of other polities in the region, including those of the Khoisan, the several Bantu kingdoms in the region before colonisation, the rule of the Dutch in the Cape and the subsequent rule of the British there and in Natal, and the so-called Boer republics, including the Orange Free State and the South African Republic. South Africa was under an official system of racial segregation and white minority rule from 1948 known as Apartheid, until its first egalitarian elections in 1994, when the ruling African National Congress came to dominate the politics of the country.
Although the Portuguese basked in the nautical achievement of successfully navigating the cape, they showed little interest in colonisation. The area's fierce weather and rocky shoreline posed a threat to their ships, and many of their attempts to trade with the local Khoikhoi ended in conflict. The Portuguese found the Mozambican coast more attractive, with appealing bays to use as way stations, for prawning, and as links to gold ore in the interior.
The Portuguese had little competition in the region until the late 16th century, when the English and Dutch began to challenge the Portuguese along their trade routes. Stops at the continent's southern tip increased, and the cape became a regular stopover for scurvy-ridden crews. In 1647, a Dutch vessel, Haarlem, was wrecked in the present-day Table Bay at Cape Town. The marooned crew, the first Europeans to attempt settlement in the area, built a fort and stayed for a year until they were rescued.
Shortly thereafter, the Dutch East India Company (in the Dutch of the day: Vereenigde Oostindische Compagnie, or VOC) decided to establish a permanent settlement. The VOC, one of the major European trading houses sailing the spice route to the East, had no intention of colonising the area, instead wanting only to establish a secure base camp where passing ships could shelter, and where hungry sailors could stock up on fresh supplies of meat, fruit, and vegetables. To this end, a small VOC expedition under the command of Jan van Riebeeck reached Table Bay on 6 April 1652.
While the new settlement traded out of necessity with the neighbouring Khoikhoi, it was not a friendly relationship, and the company authorities made deliberate attempts to restrict contact. Partly as a consequence, VOC employees found themselves faced with a labour shortage. To remedy this, they released a small number of Dutch from their contracts and permitted them to establish farms, with which they would supply the VOC settlement from their harvests. This arrangement proved highly successful, producing abundant supplies of fruit, vegetables, wheat, and citrus fruits to prevent scurvy; they also later raised livestock. The small initial group of free burghers, as these farmers were known, steadily increased in number and began to expand their farms further north and east into the territory of the Khoikhoi.
The majority of burghers had Dutch ancestry and belonged to the Calvinist Reformed Church of the Netherlands, but there were also numerous Germans as well as some Scandinavians. In 1688 the Dutch and the Germans were joined by French Huguenots, also Calvinists, who were fleeing religious persecution in France under King Louis XIV.
In addition to establishing the free burgher system, van Riebeeck and the VOC also began to import large numbers of slaves, primarily from Madagascar and Indonesia. These slaves often married Dutch settlers, and their descendants became known as the Cape Coloureds and the Cape Malays. A significant number of the offspring from the White and slave unions were absorbed into the local proto-Afrikaans speaking White population. With this additional labour, the areas occupied by the VOC expanded further to the north and east, with inevitable clashes with the Khoikhoi.
The newcomers drove the Khoikhoi from their traditional lands, decimated them with introduced diseases, and destroyed them with superior weapons when they fought back, which they did in a number of major wars and with guerrilla resistance movements that continued into the 19th century. Most survivors were left with no option but to work for the Europeans in an exploitative arrangement that differed little from slavery. Over time, the Khoisan, their European overseers, and the imported slaves mixed, with the offspring of these unions forming the basis for today's Coloured population.
The best-known Khoikhoi groups included the Griqua, who had originally lived on the western coast between St Helena Bay and the Cederberg Range. In the late 18th century, they managed to acquire guns and horses and began trekking north-east. En route, other groups of Khoisan, Coloureds, and even white adventurers joined them, and they rapidly gained a reputation as a formidable military force. Ultimately, the Griquas reached the Highveld around present-day Kimberley, where they carved out territory that came to be known as Griqualandalina.
As the burghers, too, continued to expand into the rugged hinterlands of the north and east, many began to take up a semi-nomadic pastoralist lifestyle, in some ways not far removed from that of the Khoikhoi they displaced. In addition to its herds, a family might have a wagon, a tent, a Bible, and a few guns. As they became more settled, they would build a mud-walled cottage, frequently located, by choice, days of travel from the nearest European settlement. These were the first of the Trekboers (Wandering Farmers, later shortened to Boers), completely independent of official controls, extraordinarily self-sufficient, and isolated. Their harsh lifestyle produced individualists who were well acquainted with the land. Like many pioneers with Christian backgrounds, the burghers attempted to live their lives – and to construct a theocracy – based on their particular Christian denominations (Dutch Reformed Church) reading into eisegesis characters and plot found in the Hebrew scriptures (as distinct from the Christian Gospels and Epistles).
As the 18th century drew to a close, Dutch mercantile power began to fade and the British moved in to fill the vacuum. They seized the Cape in 1795 to prevent it from falling into French hands, then briefly relinquished it back to the Dutch (1803), before definitively conquering it in 1806. British sovereignty of the area was recognised at the Congress of Vienna in 1815.
At the tip of the continent the British found an established colony with 25,000 slaves, 20,000 white colonists, 15,000 Khoisan, and 1,000 freed black slaves. Power resided solely with a white élite in Cape Town, and differentiation on the basis of race was deeply entrenched. Outside Cape Town and the immediate hinterland, isolated black and white pastoralists populated the country.
Like the Dutch before them, the British initially had little interest in the Cape Colony, other than as a strategically located port. As one of their first tasks they tried to resolve a troublesome border dispute between the Boers and the Xhosa on the colony's eastern frontier. In 1820 the British authorities persuaded about 5,000 middle-class British immigrants (most of them "in trade") to leave Great Britain behind and settle on tracts of land between the feuding groups with the idea of providing a buffer zone. The plan was singularly unsuccessful. Within three years, almost half of these 1820 Settlers had retreated to the towns, notably Grahamstown and Port Elizabeth, to pursue the jobs they had held in Britain.
While doing nothing to resolve the border dispute, this influx of settlers solidified the British presence in the area, thus fracturing the relative unity of white South Africa. Where the Boers and their ideas had before gone largely unchallenged, white South Africa now had two distinct language groups and two distinct cultures. A pattern soon emerged whereby English-speakers became highly urbanised, and dominated politics, trade, finance, mining, and manufacturing, while the largely uneducated Boers were relegated to their farms.
The gap between the British settlers and the Boers further widened with the abolition of slavery in 1834, a move that the Boers generally regarded as against the God-given ordering of the races. Yet the British settlers' conservatism stopped any radical social reforms, and in 1841 the authorities passed a Masters and Servants Ordinance, which perpetuated white control. Meanwhile, numbers of British immigrants increased rapidly in Cape Town, in the area east of the Cape Colony (present-day Eastern Cape Province), in Natal. The discovery of diamonds at Kimberley and the subsequent discovery of gold in parts of the Transvaal, mainly around present-day Gauteng led to a rapid increase in immigration of fortune seekers from all parts of the globe, including Africa itself
The early 19th century saw a time of immense upheaval relating to the military expansion of the Zulu Kingdom. Sotho-speakers know this period as the difaqane ("forced migration"); while Zulu-speakers call it the mfecane ("crushing").
The full causes of the difaqane remain in dispute, although certain factors stand out. The rise of a unified Zulu kingdom had particular significance. In the early 19th century, Nguni tribes in KwaZulu-Natal began to shift from a loosely organised collection of kingdoms into a centralised, militaristic state. Shaka Zulu, son of the chief of the small Zulu clan, became the driving force behind this shift. At first something of an outcast, Shaka proved himself in battle and gradually succeeded in consolidating power in his own hands. He built large armies, breaking from clan tradition by placing the armies under the control of his own officers rather than of the hereditary chiefs. Shaka then set out on a massive programme of expansion, killing or enslaving those who resisted in the territories he conquered. His impis (warrior regiments) were rigorously disciplined: failure in battle meant death.
Peoples in the path of Shaka's armies moved out of his way, becoming in their turn aggressors against their neighbours. This wave of displacement spread throughout Southern Africa and beyond. It also accelerated the formation of several states, notably those of the Sotho (present-day Lesotho) and of the Swazi (now Swaziland).
In 1828 Shaka was killed by his half-brothers Dingaan and Umhlangana. The weaker and less-skilled Dingaan became king, relaxing military discipline while continuing the despotism. Dingaan also attempted to establish relations with the British traders on the Natal coast, but events had started to unfold that would see the demise of Zulu independence.