Ottoman–Safavid War (1623–39)

The Ottoman–Safavid War of 1623–1639 was the last of a series of conflicts fought between the Ottoman Empire and Safavid Persia, then the two major powers of the Near East, over control of Mesopotamia. After initial Persian success in capturing Baghdad and most of modern Iraq, the war became a stalemate, as the Persians were unable to press further into the Ottoman Empire, and the Ottomans themselves were distracted by wars in Europe and weakened by internal turmoil. Eventually, the Ottomans were able to recover Baghdad, and the signing of the Treaty of Zuhab ended the war in an Ottoman victory, with Mesopotamia remaining thenceforth in Ottoman hands, until lost in the aftermath of World War I.

Background
Starting in 1514, for over a century the Ottoman Empire and Savafid Persia were engaged in almost constant warfare over control of the Caucasus and Mesopotamia. The two states were the greatest powers of the Middle East, and the rivalry was further fueled by dogmatic differences: the Ottomans were Sunnis, while the Safavids were staunchly Shia Muslims of the Qizilbash sect, and seen as heretics by the Ottomans.

After the Battle of Chaldiran eliminated Safavid influence in Anatolia, during the war of 1532–1555 the Ottomans conquered Arab Iraq, taking Baghdad in 1534 and securing recognition of their gains by the Treaty of Amasya in 1555. Peace lasted for two decades before another war began in 1578. It ended with the Treaty of Istanbul in 1590, with a clear Ottoman victory: the Ottomans occupied Georgia, Yerevan, and even the former Safavid capital, Tabriz. The Persians were hard pressed, as the Ottoman advances were combined with an attack by the Shaybanids into Persian Khorasan.

The new Persian Shah, Abbas I, reorganized his army, raising the new ghulam infantry in imitation of the Janissaries, and bided his time. In 1603, he launched an offensive that retook Tabriz, Azerbaijan and Georgia. The Ottomans, distracted by wars with the Habsburg Monarchy in Europe, failed to offer effective resistance. After a successful conclusion of the War against the Mughals, feeling encouraged by the internal turmoil within the Ottoman Empire that followed the murder of Sultan Osman II, Abbas resolved to attack the Ottoman possessions in Iraq.

The war
The Shah's opportunity came with a series of rebellions in the Ottoman Empire: Abaza Mehmed Pasha, the governor of Erzurum, rose in rebellion, while Baghdad had been since 1621 in the hands of an officer of the Janissaries, the Subashi Bakr, and his followers. Bakr had sought his recognition as the local pasha from the Porte, but the Sultan had ordered Hafız Ahmed Pasha, the governor of Diyarbakir, to intervene. Bakr then turned to Abbas, who sent troops to Bakr's aid. To forestall a Persian capture of Baghdad, Hafız Ahmed quickly restored relations with Bakr, who in turn returned to the Ottoman allegiance. In response, the Persians besieged Baghdad, and took it on 14 January 1624, with the aid of Bakr's son, Muhammad. The fall of the city was followed by the massacre of a large part of its Sunni inhabitants, as the Shah endeavored to transform Baghdad into a purely Shiite city.

The fall of Baghdad was a major blow to Ottoman prestige. Ottoman garrisons and the local tribes began to defect, and the Persians soon captured most of Iraq, including the cities of Kirkuk and Mosul and the Shia holy shrines of Najaf and Karbala, which the Shah visited. In 1625, Hafız Ahmed Pasha, now Grand Vizier, marched to retake Baghdad. Despite a "scorched earth" policy ordered by the Shah, the Ottoman army reached Baghdad and invested it in November on three sides. The Ottoman assaults on the city managed to penetrate the outer fortifications, but failed to take the city before the arrival of a relief army under Shah Abbas. The Ottomans then withdrew within their strongly fortified camp, and continued to prosecute the siege. In response, Abbas decided to intercept Ottoman supply convoys. This strategy bore fruit: the Ottomans were forced to risk an attack on the Persian army, which was repulsed with heavy losses, and on 4 July 1626, the Ottoman army lifted the siege and withdrew to Mosul.

In 1629, the Ottomans, under the new and capable Grand Vizier Gazi Ekrem Khüsrev Pasha, and having secured peace with the Habsburgs, mustered their forces for another offensive. A severe winter, including floods, made operations in central Iraq impossible, however, and Khüsrev turned his army east, invading Persia proper. On 4 May 1630, he routed the Persians under Zainal Khan Begdeli Shamlu in battle at Mahidasht near Kermanshah and proceeded to sack the city of Hamadan. Khüsrev Pasha then turned back towards Baghdad and besieged it in November. However the siege had to be lifted soon, as the onset of another heavy winter threatened his lines of communication. In the wake of his withdrawal, the Persians re-established their control of Iraq, and subdued the rebellious Kurdish populations. The next few years saw constant raiding and skirmishes, without either side claiming any decisive advantage. Shah Safi sent a peace delegation to the Ottoman court, but the new Grand Vizier, Tabanıyassi Mehmed Pasha rejected its demands. The Caucasian front of the Persians flared up again in 1633, when the restless Georgian kingdoms of Kartli and Kakheti, which, under the rule of King Teimuraz, defied Safavid sovereignty. In 1634, Rustam Khan, a Georgian convert, was sent by the Shah to subdue them. Teimuraz was defeated, but managed to escape to safety in Imereti. He would however manage to restore himself on the throne of Kakheti in 1638, and even win Persian recognition of this fact.

In 1635, in a conscious effort to emulate his warrior predecessors, Sultan Murad IV himself took up the leadership of the army. The Ottomans took Revan (on 8 August) and plundered Tabriz. The victorious Sultan returned in triumph to Constantinople, but his victories were short-lived: in the spring of the next year, Shah Safi retook Revan and defeated an Ottoman army. Renewed Persian peace proposals failed, and in 1638, Murad IV himself led an army against Baghdad. The city fell in December after a siege of 39 days, effectively restoring Ottoman control over Iraq, and peace negotiations began soon after.

Aftermath
The Treaty of Zuhab, concluded on 17 May 1639, finally settled the Ottoman–Persian frontier, with Yerevan remaining Persian, and Iraq ceded to the Ottomans. Mesopotamia, which had formed an important part of various Persian empires from the time of the Achaemenids, was irrevocably lost. The peace established a permanent equilibrium of power in the region, and despite future conflicts and minor adjustments, the frontier postulated by the treaty remains to this day the western border of Iran with Iraq and Turkey.