South Africa was colonized by two different powers, the Dutch and the English. The Dutch East India Company established the first colony in 1652. The British took over the colony in 1795, returned it during the Peace of Amiens in 1802, and then re-occupied it in 1809.
Before the Dutch and the English arrived, Portugal had a major presence in the southern part of Africa. The country did extensive trading and dominated the area before the Dutch arrived, but never set up an actual colony in the region.
South Africa gained some autonomy from Britain in 1910, and further independence in 1931. South Africa became a fully independent nation on May 31, 1961.