Long before any ship arrived, Khoe and San peoples lived here, mostly moving with the seasons. Some were Sonqua line-fishers, an offshoot of the San. The Khoe called the area ǁHui ǃGais, "where clouds gather", and the mountain Hoeri 'kwaggo, "sea mountain". The Portuguese named it Taboa do Cabo, but they did not have it their own way: in 1510 the Goringhaiqua Khoekhoe beat Francisco de Almeida's men at the Battle of Salt River.
Table Bay was a port before it was a colony. At least 1,070 outward-bound ships called between 1600 and 1652, and the ǁAmmaqua, a Khoe trading group, sold their crews meat, water, salt and timber. They settled permanently beside the Camissa, a stream that comes down from the mountain.
Jan van Riebeeck and other Dutch East India Company employees landed in April 1652 with three ships. His vegetable gardens survive as the Company's Garden in the city centre. Slavery came almost at once: people from the Dutch East Indies from 1654, then 402 from present-day Benin and Angola. From then on, more non-European migrants than Europeans reached the Cape. When farms were granted on Khoekhoe grazing land along the Liesbeek, a leader named Doman organised resistance in 1659.
The Huguenots arrived in 1688, the first non-Dutch immigrants, with wine-making experience that boosted the industry you can visit today. Then the Cape changed hands. Britain invaded and won at the Battle of Muizenberg, handed the Cape back in 1802, and returned after beating the Dutch at Blaauwberg in 1806. London saw the Cape as key to its command of India.
About 39,000 enslaved people were freed in 1834, and Muslim families among them settled the area that became Bo-Kaap. The Cape's first parliament, elected in 1854, used a franchise that did not depend on race. Cecil Rhodes, made rich by diamonds, cut that back when he became prime minister. After an outbreak of bubonic plague, Black residents were blamed and moved to Ndabeni, about six kilometres east, the seed of the Cape Flats townships.
Apartheid, from 1948, took the vote from Coloured Capetonians and used the Group Areas Act to empty mixed neighbourhoods. The Cape was declared a "Coloured labour preference area", and the state spent decades trying to clear Xhosa squatter camps such as Crossroads, the centre of Black resistance here. In its last forced removal, in May and June 1986, about 70,000 people lost their homes.
On 11 February 1990, hours after leaving prison, Nelson Mandela stood on the City Hall balcony and spoke in public for the first time in decades. The city got through a drought from 2015 to 2018 by halving its water use. But 60% of Capetonians still live in townships or informal settlements, a long way out of the centre. A township tour is one way to learn about that.