This thesis explores Ottoman-Iranian relations in the period between 1722 and 1747, with a focus on the interplay between religion and politics in the foreign policy of the Ottoman Empire. It also investigates the Ottoman claim to universal caliphate in the early modern era. The thesis aims to contribute to scholarly understanding of the complex dynamics of Ottoman decision-making with regard to three regimes in Persia in four different periods: the Shiite Safavids (1501-1722), the Sunni Afghans (1722-29), the Shiite Safavids (1729-36), and Nadir Shah, who was a self-proclaimed Sunni with the Ja‘fari legal sect (1736-47). As the Russians were actively involved in the Iranian question during that period, Russo-Ottoman relations are investigated in most of the chapters. Through a close study of primary sources, this thesis claims that the Ottomans supported the Shiite Safavids against the Sunni Afghans and Nadir Shah in their aim to reestablish the Safavid dynasty in Iran. The main argument is that the Ottoman political claim to the universal Sunni caliphate, which secured the Ottoman dynasty’s legitimacy in their vast domains, led them to adopt anti-Sunni policies in Persia. A Sunni power in Iran created a major legitimacy crisis for the sultan, whose political title of Caliph could be challenged by virtue of their new neighbors’ shared religious identity. Against them, therefore, the Porte supported the Safavids, who posed a wall at the border, protecting the sultan’s legitimacy. My study thus challenges two established views in Ottoman historiography, which suggest that (1) the sultans used their caliphal title in a political sense only in the sixteenth and nineteenth centuries, and (2) sectarian differences were inherent sources of conflict in the Ottoman-Iranian axis. In terms of international relations, this thesis shows that the Porte followed a rational foreign policy in the first half of the eighteenth century in a continuity with early modern era, as particularly exemplified in the Russo-Ottoman relations, as well as in relations with other political powers in the wider Eurasian region.