Britain occupies the Dutch Cape Colony after the Battle of Blaauwberg.

The Battle of Blaauwberg, also known as the Battle of Cape Town, fought near Cape Town on Wednesday 8 January 1806, was a small but significant military engagement. After a British victory, peace was made under the Treaty Tree in Woodstock. It established British rule over the Dutch Cape Colony, which was to have many ramifications for the region during the nineteenth and twentieth centuries. A bi-centennial commemoration was held in January 2006.

The Cape Colony (Dutch: Kaapkolonie) was a Dutch United East India Company (VOC) colony in Southern Africa, centered on the Cape of Good Hope, from where it derived its name. The original colony and its successive states that the colony was incorporated into occupied much of modern South Africa. Between 1652 and 1691 it was a Commandment, and between 1691 and 1795 a Governorate of the United East India Company (VOC). Jan van Riebeeck established the colony as a re-supply and layover port for vessels of the VOC trading with Asia. The Cape came under VOC rule from 1652 to 1795 and again from 1803 to 1806. Much to the dismay of the shareholders of the VOC, who focused primarily on making profits from the Asian trade, the colony rapidly expanded into a settler colony in the years after its founding.

As the only permanent settlement of the Dutch United East India Company not serving as a trading post, it proved an ideal retirement place for employees of the company. After several years of service in the company, an employee could lease a piece of land in the colony as a Vryburgher ('free citizen'), on which he had to cultivate crops that he had to sell to the United East India Company for a fixed price. As these farms were labour-intensive, Vryburghers imported slaves from Madagascar, Mozambique and Asia (Dutch East Indies and Dutch Ceylon), which rapidly increased the number of inhabitants. After King Louis XIV of France revoked the Edict of Nantes (October 1685), which had protected the right of Huguenots in France to practise Protestant worship without persecution from the state, the colony attracted many Huguenot settlers, who eventually mixed with the general Vryburgher population.

Due to the authoritarian rule of the company (telling farmers what to grow for what price, controlling immigration, and monopolising trade), some farmers tried to escape the rule of the company by moving further inland. The company, in an effort to control these migrants, established a magistracy at Swellendam in 1745 and another at Graaff Reinet in 1786, and declared the Gamtoos River as the eastern frontier of the colony, only to see the Trekboers cross it soon afterwards. In order to avoid collision with the Bantu peoples advancing south and west from east central Africa, the VOC agreed in 1780 to make the Great Fish River the boundary of the colony.

In 1795, after the Battle of Muizenberg in present-day Cape Town, the British occupied the colony. Under the terms of the Peace of Amiens of 1802, Britain acceded the colony to the Dutch on 1 March 1803, but as the Batavian Republic had since nationalized the United East India Company (1796), the colony came under the direct rule of The Hague. Dutch control did not last long, however, as the outbreak of the Napoleonic Wars (18 May 1803) invalidated the Peace of Amiens. In January 1806, the British occupied the colony for a second time after the Battle of Blaauwberg at present-day Bloubergstrand. The Anglo-Dutch Treaty of 1814 confirmed the transfer of sovereignty to Great Britain.