In the east, the Ottomans were often at war with Safavid Persia over conflicts stemming from territorial disputes or religious differences between the 16th and 18th centuries. The Ottoman wars with Persia continued as the Zand, Afsharid, and Qajar dynasties succeeded the Safavids in Iran, until the first half of the 19th century.
Even further east, there was an extension of the Habsburg-Ottoman conflict, in that the Ottomans also had to send soldiers to their farthest and easternmost vassal and territory, the Aceh Sultanate in Southeast Asia, to defend it from European colonizers as well as the Latino invaders who had crossed from Latin America and had Christianized the formerly Muslim-dominated Philippines.
From the 16th to the early 20th centuries, the Ottoman Empire also fought twelve wars with the Russian Tsardom and Empire. These were initially about Ottoman territorial expansion and consolidation in southeastern and eastern Europe; but starting from the Russo-Turkish War (1768–1774), they became more about the survival of the Ottoman Empire, which had begun to lose its strategic territories on the northern Black Sea coast to the advancing Russians.
From the second half of the 18th century onwards, the Ottoman Empire began to decline. The Tanzimat reforms, initiated by Mahmud II just before his death in 1839, aimed to modernise the Ottoman state in line with the progress that had been made in Western Europe. The efforts of Midhat Pasha during the late Tanzimat era led the Ottoman constitutional movement of 1876, which introduced the First Constitutional Era, but these efforts proved to be inadequate in most fields, and failed to stop the dissolution of the empire.
As the empire gradually shrank in size, military power and wealth; especially after the Ottoman economic crisis and default in 1875 which led to uprisings in the Balkan provinces that culminated in the Russo-Turkish War (1877–1878); many Balkan Muslims migrated to the Empire’s heartland in Anatolia, along with the Circassians fleeing the Russian conquest of the Caucasus. The decline of the Ottoman Empire led to a rise in nationalist sentiment among its various subject peoples, leading to increased ethnic tensions which occasionally burst into violence, such as the Hamidian massacres of Armenians.