In 1915, during the South West Africa Campaign of World War I, South Africa captured the German colony. After the war, it was declared a League of Nations Class C Mandate territory under the Treaty of Versailles, with the Union of South Africa responsible for the administration of South West Africa. From 1922, this included Walvis Bay, which, under the South West Africa Affairs Act, was governed as if it were part of the mandated territory. South West Africa remained a League of Nations Mandate until World War II and the collapse of the League of Nations.