In the aftermath of the Balkan Wars Bulgarian opinion turned against Russia and the western powers, whom the Bulgarians felt had done nothing to help them. The government of Vasil Radoslavov aligned Bulgaria with Germany and Austria-Hungary, even though this meant also becoming an ally of the Ottomans, Bulgaria's tradional enemy. But Bulgaria now had no claims against the Ottomans, whereas Serbia, Greece and Romania (allies of Britain and France) were all occupying lands which Bulgaria claimed. Bulgaria, recuperating from the Balkan Wars, sat out the first year of World War I, but when Germany promised to restore the boundaries of the Treaty of San Stefano, Bulgaria, which had the largest army in the Balkans, declared war on Serbia in October 1915. Britain, France and Italy then declared war on Bulgaria.
Although Bulgaria, in alliance with Germany and the Ottomans, won military victories against Serbia and Romania, occupying much of Macedonia (taking Skopje in October), advancing into Greek Macedonia, and taking Dobruja from the Romanians in September 1916, the war soon became unpopular with the majority of Bulgarian people, who suffered great economic hardship and also disliked fighting their fellow Orthodox Christians in alliance with the Muslim Ottomans. The Agrarian Party leader, Aleksandur Stamboliyski, was imprisoned for his opposition to the war. The Russian Revolution of February 1917 had a great effect in Bulgaria, speading antiwar and anti-monarchist sentiment among the troops and in the cities. In June Radoslavov's government resigned. Mutinies broke out in the army, Stamboliyski was released and a republic was proclaimed.
In September 1918 the French and Greeks broke through on the Macedonian front and Tsar Ferdinand was forced to sue for peace. Stamboliyski favoured democratic reforms, not a revolution. In order to head off the revolutionaries, he persuaded Ferdinand to abdicate in favour of his son Boris III. The revolutionaries were suppressed and the army disbanded. Under the Treaty of Neuilly (November 1919), Bulgaria lost its Aegean coastline to Greece and nearly all of its Macedonian territory to the new state of Yugoslavia, and had to give Dobruja back to the Romanians (see also Dobruja, Western Outlands, Western Thrace). Elections in March 1920 gave the Agrarians a large majority, and Stamboliyski formed Bulgaria's first genuinely democratic government.
Stamboliski faced huge social problems in what was still a poor country inhabited mostly by peasant smallholders. Bulgaria was saddled with huge war reparations to Yugoslavia and Romania, and had to deal with a flood of refugees as Bulgarians were expelled from Yugoslav Macedonia. Nevertheless Stamboliyski as able to carry through many social reforms, although opposition from the Tsar, the landlords and the officers of the much-reduced but still influential army was powerful. Another bitter enemy was the Internal Macedonian Revolutionary Organization (VMRO), which favoured a war to regain Macedonia for Bulgaria. Faced with this array of enemies, Stamboliyski allied himself with the Bulgarian Communist Party and opened relations with the Soviet Union.
In March 1923 Stamboliyski signed an agreement with Yugoslavia recognising the new border and agreeing to suppress VMRO. This triggered a nationalist reaction, and on June 9 there was a coup in which Stamboliykski was assassinated. A right wing government under Aleksandur Tsankov took power, backed by the Tsar, the army and the VMRO, who waged a White terror against the Agrarians and the Communists. The Communist leader Georgi Dimitrov fled to the Soviet Union. There was savage repression in 1925 following an attempt on the Tsar's life and a bomb attack on Sofia Cathedral. But in 1926 the Tsar persuaded Tsankov to resign and a more moderate government under Andrey Lyapchev took office. An amnesty was proclaimed, although the Communists remained banned. The Agrarians reorganised and won elections in 1931 under the leadership of Nikola Mushanov.
Just when political stability had been restored, the full effects of the Great Depression hit Bulgaria, and social tensions rose again. In May 1934 there was another coup, the Agrarians were again suppressed, and an authoritarian regime headed by Kimon Georgiev established with the backing of Tsar Boris. In April 1935 Boris took power himself, ruling through puppet Prime Ministers Georgi Kyoseivanov (1935-40) and Bogdan Filov (1940-43). The Tsar's regime banned all opposition parties and took Bulgaria into alliance with Nazi Germany and Fascist Italy. Although the signing of the Balkan Pact of 1938 restored good relations with Yugoslavia and Greece, the territorial issue continued to simmer.