With the Treaty of Zuhab in 1639, most of the territory of present-day Iraq eventually came under the control of Ottoman Empire as the eyalet of Baghdad as a result of wars with the neighboring rival, Safavid Iran. Throughout most of the period of Ottoman rule (1533–1918), the territory of present-day Iraq was a battle zone between the rival regional empires and tribal alliances.
By the 17th century, the frequent conflicts with the Safavids had sapped the strength of the Ottoman Empire and had weakened its control over its provinces. The nomadic population swelled with the influx of Bedouins from Najd, in the Arabian Peninsula. Bedouin raids on settled areas became impossible to curb.
During the years 1747–1831, Iraq was ruled by a Mamluk dynasty of Georgian origin who succeeded in obtaining autonomy from the Ottoman Porte, suppressed tribal revolts, curbed the power of the Janissaries, restored order and introduced a program of modernization of economy and military. In 1831, the Ottomans managed to overthrow the Mamluk regime and imposed their direct control over Iraq. The population of Iraq, estimated at 30 million in 800 AD, was only 5 million at the start of the 20th century.
During World War I, the Ottomans sided with Germany and the Central Powers. In the Mesopotamian campaign against the Central Powers, British forces invaded the country and initially suffered a major defeat at the hands of the Turkish army during the Siege of Kut (1915–1916).
However, subsequent to this the British began to gain the upper hand, and were further aided by the support of local Arabs and Assyrians. In 1916, the British and French made a plan for the post-war division of Western Asia under the Sykes-Picot Agreement. British forces regrouped and captured Baghdad in 1917, and defeated the Ottomans.
An armistice was signed in 1918. The British lost 92,000 soldiers in the Mesopotamian campaign. Ottoman losses are unknown but the British captured a total of 45,000 prisoners of war. By the end of 1918, the British had deployed 410,000 men in the area, of which 112,000 were combat troops.
British Administration and Independent Kingdom:
The country today known as Iraq was a region of the Ottoman Empire until the partition of the Ottoman Empire in the 20th century. It was made up of three provinces, called vilayets in the Ottoman language: Mosul Vilayet, Baghdad Vilayet, and Basra Vilayet. These three provinces were joined into one Kingdom by the British after the region became a League of Nations mandate, administered under British control, with the name “State of Iraq”.
A fourth province (Zor Sanjak), which Iraqi nationalists considered part of Upper Mesopotamia was ultimately added to Syria. In line with their “Sharifian Solution” policy, the British established the Hashemite king, Faisal I of Iraq, who had been forced out of Syria by the French, as their client ruler. Likewise, British authorities selected Sunni Arab elites from the region for appointments to government and ministry offices.