Situated in the eastern Balkans, Bulgaria was ruled by the Byzantine Empire from 1018 to 1185, and by the Ottoman Empire from 1396 to 1878. Northern Bulgaria attained autonomy in 1878 and all of Bulgaria became independent from the Ottoman Empire in 1908. After World War II, Bulgaria fell within the Soviet sphere of influence and became a communist country in 1946. Communist domination ended in 1990, and Bulgaria has since been a parliamentary democracy. Its transition to democracy and a market economy after the collapse of communism has not been easy, and the country experienced a sharp economic decline in the early and mid-1990s. Implementation of economic reforms since the late 1990s has led to economic stabilization and steady growth. Bulgaria joined NATO in 2004 and the EU in 2007.