The history of the Cape Colony from 1806 to 1870 spans the period of the history of the Cape Colony during the Cape Frontier Wars, which lasted from 1779 to 1879. The wars were fought between the European colonists and the native Xhosa who, defending their land, fought against European rule.

The Cape Colony was the first European colony in South Africa, which was initially controlled by the Dutch but subsequently invaded and taken over by the British. After war broke out again, a British force was sent once more to the Cape. After a battle in January 1806 on the shores of Table Bay, the Dutch garrison of Cape Castle surrendered to the British under Sir David Baird, and in 1814, the colony was ceded outright by the Netherlands to the British crown. At that time, the colony extended to the mountains in front of the vast central plateau, then called "Bushmansland", and had an area of about 194,000 square kilometres and a population of some 60,000, of whom 27,000 were white, 17,000 free Khoikhoi, and the rest slaves. These slaves were mostly people brought in from other parts of Africa and Malays.

First and second frontier wars

The first of several wars with the Xhosa had already been fought by the time that the Cape Colony had been ceded to the United Kingdom. The Xhosa that crossed the colonial frontier had been expelled from the district between the Sundays River and Great Fish River known as the Zuurveld, which became a neutral ground of sorts. For some time before 1811, the Xhosa had taken possession of the neutral ground and attacked the colonists. In order to expel them from the Zuurveld, Colonel John Graham took the area with a mixed-race army in December 1811, and eventually the Xhosa were forced to fall back beyond the Fish River. On the site of Colonel Graham’s headquarters arose a town bearing his name: Graham's Town, subsequently becoming Grahamstown.

A difficulty between the Cape Colony government and the Xhosa arose in 1819, the immediate cause of which was an attempt by the colonial authorities to enforce the restitution of some stolen cattle. On 22 April 1819, led by a prophet-chief named Makana, they attacked Graham’s Town, then held by a handful of white troops. Upon the arrival of reinforcements, the Xhosa troops retreated. It was then agreed that the land between the Fish and the Keiskamma rivers should be neutral territory.

1820 Settlers The war of 1817–1819 led to the first wave of immigration of British settlers of any considerable scale, an event with far-reaching consequences. The then-governor, Lord Charles Somerset, whose treaty arrangements with the Xhosa chiefs had proved untenable, wished to buffer the Cape from contact with the Xhosa by settling white colonists in the border region. In 1820, upon the advice of Lord Somerset, Parliament voted to spend £50,000 (£ today) to promote migration to the Cape, encouraging 4,000 British people to migrate to the buffer area. These immigrants, now known as the 1820 Settlers, settled in an area they called Albany and grew settlements in Port Elizabeth and Grahamstown. The settlers were intended primarily to secure the frontier, as well as a means for the British government to relieve unemployment in Britain. However, the scheme had further implications: the settlers retained their loyalty to Britain, and in the course of time, formed a counterpoint to the Dutch colonists.

This migration also introduced the English language to the Cape. English language ordinances were issued for the first time in 1825, and in 1827, the use of English was extended to judicial proceedings. Dutch was not, however, ousted, and the colonists became largely bilingual.

Over the ensuing decades, there was considerable political tension between the eastern and the western halves of the Cape Colony. The Eastern Cape, from its major port and urban centre Port Elizabeth, resented being ruled from Cape Town in the Western Cape, and frequently agitated to become a separate colony. These separatist tensions did not completely die down until the 1870s, when Prime Minister John Molteno restructured the Cape administration to meet the major concerns of the eastern colonists and, in the Constitutional Amendment Bill of 1873, abolished the last formal distinctions.

Dutch hostility to British rule Although the colony was prosperous, many Dutch farmers were as dissatisfied with British rule as they had been with that of the Dutch East India Company, though their grievances were not the same. In 1792, Moravian missions had been established for the benefit of the Khoikhoi, and in 1799, the London Missionary Society began to try to convert both the Khoikhoi and the Xhosa. The championship of Khoikhoi grievances by the missionaries caused much dissatisfaction among the majority of the colonists, whose conservative views temporarily prevailed, for in 1812, an ordinance was issued which gave magistrates the power to bind Khoikhoi children as apprentices under conditions little different from those of slavery. In the meantime, the movement for the abolition of slavery was gaining strength in England, and the missionaries appealed at length, from the colonists to Britain.

An incident which occurred from 1815 to 1816 did much to make the Dutch frontiersmen permanently hostile to the British. A farmer named Bezuidenhout refused to obey a summons issued to him after a complaint from Khoikhoi was registered. He fired on the party sent to arrest him, and was killed by the return fire. This caused a miniature rebellion, and in its suppression five ringleaders were publicly hanged by the British at Slagter's Nek where they had originally sworn to expel "the English tyrants". The resentment caused by the hanging of these men was deepened by the circumstances of the execution, for the scaffold on which the rebels simultaneously were hanged broke from their united weight and the men were hanged one by one afterwards. The deeply religious Dutch frontiersmen believed the collapsing scaffold to be an act of God. An ordinance passed in 1827 abolished the old Dutch and courts, instead substituting resident magistrates. The ordinance further stipulated that all legal proceedings be henceforth conducted in English.

A subsequent ordinance in 1828 granted equal rights with white people to the Khoikhoi and other free African people in the Cape. Another ordinance in 1830 imposed heavy penalties for harsh treatment of slaves, and finally the emancipation of slaves was proclaimed in 1834. Each of these ordinances drew further ire from the Dutch farmers towards the Cape government. Moreover, the inadequate compensation awarded to slave-owners, and the suspicions engendered by the method of payment, caused much resentment, and in 1835 the trend where farmers trekked into unknown country in order to escape from a disliked government recommenced. Emigration beyond the colonial border had in fact been continuous for 150 years, but it now took on larger proportions.

Third cape frontier war (1834–1836)

On the eastern border, further trouble arose between the government and the Xhosa, towards whom the policy of the Cape government was marked by much vacillation. On 11 December 1834, a government commando party killed a Xhosa chief of high rank, incensing the Xhosa: an army of 10,000 men, led by Maqoma, a brother of the chief who had been killed, swept across the frontier, pillaged and burned the homesteads and killed all who resisted. Among the worst sufferers was a colony of freed Khoikhoi who, in 1829, had been settled in the Kat River valley by the British authorities. There were few available soldiers in the colony, but the governor, Sir Benjamin d'Urban acted quickly and all available forces were mustered under Colonel Sir Harry Smith, who reached Graham's Town on 6 January 1835, six days after news of the violence had reached Cape Town. The British fought the Xhosa warriors for nine months until hostilities were ended on 17 September 1836 with the signing of a new peace treaty, by which all the country as far as the River Kei was acknowledged to be British, and its inhabitants declared British subjects. A site for the seat of government was selected and named King William's Town.

Great Trek (1836–1840) The British government did not approve of the actions of Sir Benjamin d'Urban, and the British Secretary for the Colonies, Lord Glenelg, declared in a letter to the King that "the great evil of the Cape Colony consists in its magnitude" and demanded that the boundary be moved back to the Fish River. He also eventually had d'Urban dismissed from office in 1837. Lord Glenelg's dispatch of 26 December stated: "The Kaffirs had an ample justification for war; they had to resent, and endeavoured justly, though impotently, to avenge a series of encroachments." This attitude towards the Xhosa was one of the many reasons given by the Voortrekkers for leaving the Cape Colony. The Great Trek, as it is called, lasted from 1836 to 1840. The trekkers (Boers), numbering around 7,000, founded communities with a republican form of government beyond the Orange and Vaal rivers, and in Natal, where they had been preceded, however, by British emigrants. From this time on, Cape Colony ceased to be the only European community in South Africa, though it was the most predominant for many years.

Considerable trouble was caused by the emigrant Boers on either side of the Orange River, where the Boers, the Basothos, other native tribes, Bushmen, and Griquas fought for superiority, while the Cape government endeavoured to protect the rights of the native Africans. On the advice of the missionaries, who exercised great influence on all non-Dutch people, a number of the "native states" were recognised and subsidised by the Cape government with the objective of creating peace on the northern frontier. The first "Treaty States" to be recognised was Griqualand West of the Griqua people. Subsequent states were recognised between 1843 and 1844. While the northern frontier became more secure, the state of the eastern frontier was deplorable, with the government either unable or unwilling to settle disputes between Xhosa and Cape farmers.

Elsewhere, however, the colony was making progress. The change from slave to free labour proved to be advantageous to the farmers in the western provinces. An efficient education system, owing its inception to Sir John Herschel, an astronomer who lived in Cape Colony from 1834 to 1838, was adopted. Road Boards were established and proved to be very effective in constructing new roads. A new stable industry, sheep-raising, was added to the original set of wheat-growing, cattle rearing, and wine making. By 1846, wool became the country's most valuable export. A legislative council was established in 1835, giving the colonists a share in the government.

War of the Axe (1846) Another war with the Xhosa, known as the War of the Axe or Amatola War, broke out in 1846, when a Khoikhoi escort who had been manacled to a Xhosa thief was murdered while transporting the man to Graham's Town to be tried for stealing an axe. A party of Xhosa attacked and killed the escort. The surrender of the murderer was refused, and war was declared in March 1846. The Ngqikas were the chief tribe engaged in the war, assisted by the Ndlambe and Thembu. The Xhosa were defeated on 7 June 1846 by General Somerset on the Gwangu, a few miles from Fort Peddie. However, the war continued until Sandile, the chief of the Ngqika, surrendered. Other chiefs gradually followed this action, and by the end of 1847 the violence died down after 21 months of fighting.

Extension of British sovereignty (1847)

In December 1847, or what was to be the last month of the War of the Axe, Sir Harry Smith reached Cape Town by boat to become the new governor of the colony.

Expansion of the Cape Colony