After the Russo-Turkish War, an autonomous Bulgarian state was created within the Ottoman Empire by the Treaty of Berlin in 1878. Although remaining under Ottoman sovereignty, it functioned independently, taking Alexander of Battenberg as its first prince. In 1885 it took control of the still-Ottoman Eastern Rumelia, officially under a personal union. Following the abdication of Alexander, Ferdinand I was elected prince in 1887. Full independence was declared in 1908.
The 1912–1913 Balkan Wars, Bulgaria initially formed an alliance with Greece and Serbia against the Ottoman Empire, together liberating a great deal of Ottoman territory. Bulgaria was however unhappy with the resulting division of territory, and soon went to war against its former allies, in which it lost territory it had gained in the first war. The First World War saw Bulgaria allied with Germany, Austria-Hungary, and the Ottoman Empire. Its defeat led to the Treaty of Neuilly-sur-Seine, in which it lost further territory. Social problems and political instability persisted throughout the interwar years. In the Second World War, Bulgaria again allied with Germany. Although it attempted to pull out of the war as Soviet Union advanced towards it, it was invaded, and a communist government was put into power.
The proposed Treaty of San Stefano of March 3, 1878 provided for a self-governing Bulgarian state, which comprised the geographical regions of Moesia, Thrace and Macedonia. Fearing the establishment of a large Russian client state on the Balkans, the other Great Powers, especially Britain and Austro-Hungary, were not willing to agree to the treaty. The British were concerned over the safety of their routes to the Suez Canal and India. The Dual Monarchy that was the Austria-Hungarian Empire was afraid that establishment of a large independent Slavic state in the Balkans would encourage other Slavs living in the Austro-Hungarian Empire to also seek an independent break away state. Accordingly, both Britain and Austria-Hungary sought for the treaty to be revised.