Britain had fought the Boer settlers in South Africa in the Anglo-Boer wars (1880-1, 1899-1902), so in 1914 many Afrikaaners sympathised with Germany. While Prime Minister, Louis Botha was raising an expedition to invade German South West Africa, pro-German Boers raised a rebellion against British authority. This was not fully suppressed until early 1915 and only then could the invasion of South West Africa be fully launched. On 5 March 1916 South African Troops, led by General Jan Smuts, invaded East Africa in their confrontation with German forces. More than 146 000 Whites, 83 000 Blacks and 2 500 people of mixed race and Asians served in South African military units during the war, including 43,000 in German South-West Africa and 30 000 on the Western Front.
An estimated 3,000 South Africans also joined the Royal Flying Corps. The total number of South African casualties during the war was approximately 7000 dead and 12 000 wounded by 1918. South Africa greatly assisted the Allies, and Great Britain in particular, in capturing the two German colonies of German West Africa and German East Africa (although many South African troops were tied down by the failure to capture all the German East Africa forces) as well as in battles in Western Europe and the Middle East. South Africa's ports and harbors, such as at Cape Town, Durban, and Simon's Town, were also important rest-stops, refueling-stations, and served as strategic assets to the British Royal Navy during the war, helping to keep the vital sea lanes to the British Raj open.