The first part of the paper examines the evolution and transformation of Safavid ideology in the context of confessional changes and the role of Turkoman tribes in the Safavid social movement in the Ottoman‒Iranian borderland. The second part examines the impact of Ottoman‒Safavid wars and religious rivalry on the society and economy of Azerbaijan from the sixteenth to the eighteenth centuries.