After the German occupation of Denmark on 9 April 1940, the Althing replaced the King with a regent and declared that the Icelandic government should assume the control of foreign affairs and other matters previously handled by Denmark.