In 1906, popular protests which had begun over the treatment of some merchants by the governor of Tehran grew in size until a group of several thousand merchants, artisans, religious leaders, students, and intellectuals took refuge (a customary right to sanctuary known as bast ) on the grounds of the British legation, where they began to organize political demonstrations. They articulated as their main demand the election of a national assembly (Majles), and this was approved by Mozaffar-od-Din Shah. Mozaffar-od-Din died shortly thereafter, in January 1907, and the new ruler, Mohammad-‘Ali Shah, was much less sympathetic to this Constitutional Revolution. Divisions also began to appear among the constitutionalists themselves, with some favoring a secular system based on the concept of popular sovereignty, and others a more conservative system that would have given religious leaders a veto over legislation deemed un-Islamic. In 1908, Mohammad-‘Ali Shah, backed by the Russian-officered Cossack Brigade, staged a coup; the Majles was attacked, and prominent constitutionalists were killed, arrested, or forced to flee. Supporters of the constitution rallied in Tabriz, which held out against a siege by royalist forces, and in other parts of the country. In 1909, Russian forces intervened to break the siege of Tabriz, and pro-constitutionalist forces advanced on Tehran from Gilân in the north and Fârs in the south. A special assembly then deposed Mohammad-‘Ali Shah, who was sent into exile in Russia, and put his son Ahmad Shah on the throne. The Second Majles proved much too independent-minded for either the Russians or the British. The imperial powers were particularly irritated that the Majles turned to an American, Morgan Shuster, for help in solving the country’s financial crisis, and that Shuster proved to be both effective and willing to put Iran’s interests ahead of those of Russia and Britain. With British approval, Russia issued an ultimatum in 1911 demanding Shuster’s dismissal, invaded the country, dissolved the Majles, and crushed the remaining pockets of constitutionalist resistance.

World War I added to the troubles in Iran. Even though Iran was not a party to the war, it was caught between the opposing forces. The Russians maintained troops in Qazvin and the north, and the British moved in troops to protect their oil installations in the south. German agents were active in the country and stirred up tribal revolts against the British, and their Ottoman allies warred vigorously with the Russians in Azerbaijan and pressured the British in Khuzestân. Economic crisis and food shortages caused much hardship for the Iranian population. Ethnic minorities in Kurdistan, Azerbaijan, and Gilân looked for an opportunity to gain provincial autonomy or even independence.

The end of the war, with the collapse of Russia and the Bolshevik Revolution, left Britain as the dominant power in Iran. The British government moved quickly to pressure Iran into accepting an agreement that would have turned the country into a virtual British protectorate. Rumors about the Anglo-Persian Agreement of 1919 galvanized resistance to it in Iran and alarmed foreign powers, notably the new Soviet regime, which did not want to see Iran become a base for counterrevolution. Defeated White Russians had taken refuge in Iran, and it appeared that the Russian officers of the Cossack Brigade and, to some extent, British forces were collaborating with them. Elements of the Red Army occupied Anzali in 1920, pushing the British and Cossack Brigade back to Qazvin; the Soviets announced they would not leave Iran as long as British troops were there. To avoid drawing the Soviets further in, to dampen political unrest, and to deal with problems elsewhere in their empire, the British decided to abandon the Anglo-Persian Agreement and withdraw their forces from Iran, while hoping to leave behind a viable and pro-British government. They also decided to remove the remaining Russian officers from the Cossack Brigade, which would be placed under the command of an outstanding Iranian officer, Colonel Rezâ Khân.