The Ottoman–Persian Wars or Ottoman–Iranian Wars were a series a wars between Ottoman Empire and the Safavid, Afsharid, Zand, and Qajar dynasties of Iran (Persia) through the 16th–19th centuries. The Ottomans consolidated their control of what is today Turkey in the 15th century, and gradually came into conflict with the emerging neighboring Persian state, led by Ismail I of the Safavid dynasty. The two states were arch rivals, and were also divided by religious grounds, the Ottomans being staunchly Sunni and the Safavids being Shia. A series of military conflicts ensued for centuries during which the two empires competed for control over eastern Anatolia, the Caucasus, and Iraq.