The government declared independence from the Ottoman Empire in 1912. Then, in 1939, the country was successfully invaded by Italy. Shortly after that, in 1944, Communist loyalist took control. For the next several decades, Albania aligned itself first with Russia (until 1960) and then China (until 1978).