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.