In the 1912–1913 Balkan Wars, Bulgaria initially formed an alliance with Greece, Serbia and Montenegro against the Ottoman Empire, and together they liberated a great deal of Ottoman territory. Bulgaria, however, unhappy with the resulting division of territory, soon went to war against its former allies Serbia and Greece and lost territory it had gained in the first war. The First World War (1914–1918) saw Bulgaria fighting (1915–1918) alongside Germany, Austria-Hungary, and the Ottoman Empire. Defeat led to the Treaty of Neuilly-sur-Seine (27 November 1919), in accordance with which Bulgaria lost further territory. Social problems and political instability persisted throughout the interwar years. In the Second World War (1939–1945), Bulgaria again allied with Germany (March 1941). Although Sofia attempted to pull out of the war as the Soviet Union advanced towards its territory (1944), the Red Army invaded (September 1944), and a communist government came (1944–1946) to power and established the People's Republic of Bulgaria (1946–1990).