Circassians began entering the Ottoman Empire en masse during the expansion of the Tsarist Russian Empire into their Caucasian homeland during the 1850s. An 1860 agreement between the Ottomans and the Russians mandated the immigration of 40,000–50,000 Circassians into Ottoman territory. However, between 800,000 and 1,200,000 Muslim Circassians entered and settled in the Ottoman Empire, of whom some 175,000 were resettled by the government in the Empire's predominantly Christian Balkan territories in 1864. The Balkan Crisis of 1876, which led to the Russo–Turkish War of 1877–1878, was partly attributed to the killings of Bulgarian Christians by Circassian settlers. During the subsequent Russian occupation of Bulgaria and Eastern Rumelia the Circassians were expelled from the Balkans, which was formalized by the Treaty of Berlin in 1878. Coinciding with the crisis in the Balkans, further waves of Circassians and Chechens from the Caucasus and Turkmens from Central Asia were fleeing Russian rule and becoming refugees in eastern Anatolia.