Under Filov's government Bulgaria drifted into World War II, bribed by the return of southern Dobruja from Romania, on the orders of Hitler (see Vienna Award), in September 1940. In March 1941 Bulgaria formally signed the Tripartite Pact, becoming a German ally, and German troops entered the country in preparation for the German invasion of Greece. When Yugoslavia and Greece were defeated, Bulgaria was allowed to occupy all of Greek Thrace and most of Macedonia. Bulgaria declared war on Britain and the United States, but resisted German pressure to declare war on the Soviet Union, fearful of pro-Russian sentiment in the country.
In August 1943 Tsar Boris died suddenly (possibly assassinated, although this has never been proved) and was succeeded by his six-year old son Simeon II. Power was held by a council of regents headed by the young Tsar's uncle, Prince Kirill. The new Prime Minister, Dobri Bozhilov, was in most respects a German puppet. (To this government's credit, however, is the fact that it resisted German demands for the deportation of Bulgaria's 50,000 Jews.)
Resistance to the Germans and the Bulgarian regime was widespread by 1943, co-ordinated by a Fatherland Front which embraced the Agrarians, now led by Nikola Petkov, the Social Democrats and the Communists, and including even many army officers. Partisans operated in the mountainous west and south. By 1944 it was obvious that Germany was losing the war and the regime began to look for a way out. Bozhilov resigned in May, and his successor Ivan Bagrianov tried to arrange negotiations with the western Allies.
But it was the Soviet army which was rapidly advancing towards Bulgaria. In August Bulgaria unilaterally announced its withdrawal from the war and asked the German troops to leave: Bulgarian troops were hastily withdrawn from Greece and Yugoslavia. In September the Soviets crossed the northern border. The government, desperate to avoid a Soviet occupation, declared war on Germany, but the Soviets could not be put off, and on September 8 they declared war on Bulgaria - which thus found itself for a few days at war with both Germany and the Soviet Union. On September 16, the Soviet army entered Sofia.
The Fatherland Front took office in Sofia, setting up a broad coalition under the former ruler Kimon Georgiev and including the Social Democrats and the Agrarians. Under the terms of the peace settlement, Bulgaria was allowed to keep southern Dobruja, but formally renounced all claims to Greek and Yugoslav territory. To prevent further disputes 150,000 Bulgarians were expelled from Greek Thrace. The Communists deliberately took a minor role in the new government at first, but the Soviet representatives were the real power in the country. A Communist-controlled People's Militia was set up, which harassed and intimidated non-Communist parties.
In February 1945 the new realities of power in Bulgaria were shown when Prince Kirill and hundreds of other officials of the old regime were arrested on charges of war crimes. By June Kirill and the other regents, 22 former ministers and many others had been executed. In September 1946 the monarchy was abolished by plebiscite, and young Tsar Simeon was sent into exile. The Communists now openly took power, with Vasil Kolarov becoming President and Dimitrov becoming Prime Minister. Free elections promised for 1946 were blatantly rigged and were boycotted by the opposition. The Agrarians refused to co-operate with the new regime, and in June 1947 their leader Nikola Petkov was arrested. Despite strong international protests he was executed in September. This marked the final establishment of a Communist regime in Bulgaria.