Bulgaria was initially a part of the Byzantine Empire. When the Byzantine Empire fell it became independent. The Ottoman Empire conquered it in 1396. Bulgaria remained a member of the empire until 1878 when it became partially independent. It achieved full independence in 1908. Bulgaria participated in the Balkans Wars, which resulted in its loss of territory. During World War II Bulgaria was allied with Germany. At the end of the war the Soviet Union occupied the country and installed a communist government in Bulgaria. In 1990 a democratic government took control of Bulgaria.