<P> During World War II, South Africa's ports and harbours, such as at Cape Town, Durban, and Simon's Town, were important strategic assets to the British Royal Navy . South Africa's top - secret Special Signals Service played a significant role in the early development and deployment of radio detection and ranging (radar) technology used in protecting the vital coastal shipping route around southern Africa . By August 1945, South African Air Force aircraft in conjunction with British and Dutch aircraft stationed in South Africa had intercepted 17 enemy ships, assisted in the rescue of 437 survivors of sunken ships, attacked 26 of the 36 enemy submarines operating the vicinity of the South African coast, and flown 15,000 coastal patrol sorties . </P> <P> About 334,000 South Africans volunteered for full - time military service in support of the Allies abroad . Nearly 9,000 were killed in action . On 21 June 1942 nearly 10,000 South African soldiers, representing one - third of the entire South African force in the field, were taken prisoner by German Field Marshal Rommel's forces in the fall of Tobruk, Libya . A number of South African fighter pilots served with distinction in the Royal Air Force during the Battle of Britain, including Group Captain Adolph "Sailor" Malan who led 74 Squadron and established a record of personally destroying 27 enemy aircraft . </P> <P> General Jan Smuts was the only important non-British general whose advice was constantly sought by Britain's war - time Prime Minister Winston Churchill . Smuts was invited to the Imperial War Cabinet in 1939 as the most senior South African in favour of war . On 28 May 1941, Smuts was appointed a Field Marshal of the British Army, becoming the first South African to hold that rank . When the war ended, Smuts represented South Africa in San Francisco at the drafting of the United Nations Charter in May 1945 . Just as he had done in 1919, Smuts urged the delegates to create a powerful international body to preserve peace; he was determined that, unlike the League of Nations, the UN would have teeth . Smuts also signed the Paris Peace Treaty, resolving the peace in Europe, thus becoming the only signatory of both the treaty ending the First World War, and that which ended the Second . </P> <P> After the suppression of the abortive, pro-German Maritz Rebellion during the South African World War I campaign against German South West Africa in 1914, the South African rebel General Manie Maritz escaped to Spain . He returned in 1923, and continued working in the Union of South Africa as a German Spy for the Third Reich . </P>

When did africa become a part of the british empire