In 642 a long period of foreign rule starts, in 642 by the Caliphate, in 1040 by the Seljuk Sultanate and in 1223 by the Mongols. After a period of fragmentation in 1379 Iran becomes part of the Timurid Empire (under Tamerlane). Between 1449 and 1499 Iran is again fragmented.
Independence is regained in 1501 as the Empire of Iran (in English generally named Persia). It undergoes a revival under the Safavid dynasty (1502-1736), the most prominent figure of which is Shah Abbas. The conqueror Nadir Shah and his successors are followed by the Zand dynasty, founded by Karim Kahn, and later the Qajar (1795-1925) dynasty. A a nationalist uprising against the shah (who remains in power) in 1905 leads to the granting of a limited constitution in 1906 and a parliament in 1907. Power remains with the emperor (shah) and absolute rule is restored in 1911. In the north of Iran an independent Soviet Republic of Gilan secedes in 1920. Gilan is retaken by Iran in 1921. During that time Iran is de facto a British protectorate.
In 1921 Reza Khan, an officer in the army, seizes control of the government. In 1925 he makes himself shah, ruling as Reza Shah Pahlavi and installing the new Pahlavi dynasty. Under his reign, Iran begins to modernize and to secularize politics and the central government reasserts its authority over the tribes and provinces. In 1941, following the Allies' (U.K.-Soviet Union) occupation of western Iran, Reza Shah is forced to abdicate. His son, Mohammad Reza Pahlavi, becomes shah.
In 1951, prime minister Mohammad Mossadegh, a militant nationalist, forces the parliament to nationalize the British-owned oil industry. Mossadeghq is opposed by the shah and removed, but he quickly returns to power. The shah flees Iran but returns when supporters stage a coup against Mossadegh in 1953. The shah rules the country as an absolute monarch. In 1961 he initiates a series of economic, social and administrative reforms that became known as the Shah's White Revolution. This develops into a constitutional monarchy and a multi-party system. Due to nationalist and Islamic resistance to his ruling he abolishes the multi-party system in 1975. Iran becomes a one-party state under the Resurrection Party (Rastakhiz). In 1978 domestic turmoil sweeps the country as a result of religious and political opposition to the shah's rule.
In 1979, the shah leaves Iran. Exiles religious leader Ayatollah Ruhollah Khomeini returns from France to direct a revolution resulting in a new, theocratic republic, the Islamic Republic of Iran, guided by islamic principles. He becomes Iran's national religious leader (rahbar). Sayyed Ali Khamenei becomes president of the republic. Following Khomeini's death in 1989 he is succeeded as rahbar by Khamenei. Although Iran is a theocratic state in which the clergy rules, it has also an elected parliament and a elected president. In 1989 Ali Akbar Hashemi-Rafsanjani is elected president by an overwhelming majority. He is re-elected in 1993 with a more modest majority. The moderate leader (Ali) Mohammad Khatami-Ardakani is elected president in 1997 with an overwhelming majority and re-elected in 2001. The main reformists are not allowed to participate in the 2004 elections due to the power of the clergy. This enables the radicals to win the 2004 elections and stop the path to reform.