The Cape Colony (Dutch: Kaapkolonie) was a Dutch East India Company colony in Southern Africa, centered on the Cape of Good Hope, whence 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 a Commandment, and between 1691 and 1795 a Governorate of the Dutch East India Company. Jan van Riebeeck established the colony as a re-supply and layover port for vessels of the Dutch East India Company trading with Asia. The Cape came under Dutch rule from 1652 to 1795 and again from 1803 to 1806. Much to the dismay of the shareholders of the Dutch East India Company, 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 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 een Vryburgher ("a free citizen"), on which he had to cultivate crops that he had to sell to the Dutch East India Company for a fixed price. As these farms were labour-intensive, Vryburghers imported slaves from Madagascar, Mozambique and Asia, 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 Trekboere cross it soon afterwards. In order to avoid collision with the Bantu peoples advancing south, north and west from east central Africa, the Dutch 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 returned the colony to the Dutch on 1 March 1803, but as the Batavian Republic had since nationalized the Dutch East India Company (1796), the colony came under the direct rule of The Hague. Renewed 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. However most of the Dutch settlers remained in the colony under new leadership of the British.