From 1939 to 1945, Australia joined theAlliesin fighting theSecond World War. Australia'sarmed forcesfought in thePacific,EuropeanandMediterranean and Middle Easttheatres.[109][110]The shock of Britain'sdefeat in Asiain 1942, followed soon after by thebombing of Darwinandother Japanese attacks on Australian soil, led to a widespread belief in Australia thata Japanese invasion was imminent, and a shift from the United Kingdom to theUnited Statesas Australia's principal ally and security partner.[111]Since 1951, Australia has been a formal military ally of theUnited States, under theANZUStreaty.[112]