The first distinct people to emerge on the Iranian plateau were probably the Elamites, who established a city at Shush in the far south-west. The Aryans came to the region in the second millennium BC, bringing with them some agricultural and domestic skills. It wasn't until the middle of the 6th century BC, when the Achaemenian king Cyrus the Great ruled the region, that Persian history was documented. The Achaemenian Dynasty is recognised as the founder of the Persian Empire, leading to the eventual creation of Iran.
In the 4th century BC Alexander the Great invaded Persia after conquering most of Greece, Egypt, Turkey and Iraq. Despite three conciliatory offers from Darius III for a negotiated peace, Alexander entered Shush. From there, he took some time to cross the mountains to the east, and eventually entered Persepolis, which was soon burned to the ground. After Alexander's death in 323 BC, the empire was divided into three squabbling dynasties, with Persia controlled by the Macedonian Seleucids. But the Seleucids had problems controlling the numerous feisty ethnic minorities, in particular the nomadic Parthians who came to control most of Persia until the 3rd century AD. The Sassanians came from the central regions of Persia not under direct control of the Parthians. They were an industrious Zoroastrian gang who promoted urban development and encouraged trade, but who eventually fell to squabbling and were overrun by the Arabs in 637.
The Arabs ruled until 1050, converting most of the population to Islam and introducing Arabic script and Islamic culture. They were brought down by a Turkish dynasty, which captured Esfahan in 1051. Despite numerous rebellions, the Turks hung onto power until they were swept clean away by Genghis Khan's rampaging Mongols in the early 13th century. When the Mongols ran out of leaders in the late 14th century, the Timurid Dynasty filled the breach, but was then pressured by Turkmen tribes, Ottoman Turks and European colonialists such as Portugal.
The ensuing Safavid Dynasty (1502-1722) was one of the great Persian empires. The brilliant Shah Abbas I and his successors enshrined Shi'ism and rebuilt Esfahan, but the dynasty's decline was hastened by Afghan invasions in the early 18th century. The Afghans couldn't hold power and Iran was ruled by a succession of variously mad, bad and benevolent rulers until the even badder Agha Mohammed Khan, a eunuch, united the Turkish Qajars in 1779 and went on to establish a capital in Tehran. The Qajar kings ruled a relatively peaceful but ruinously corrupt Iran until 1921, managing to remain neutral during WWI, but were not able to prevent a partial occupation by British forces keen to ensure a constant supply of oil.
One of the last Qajar kings briefly entertained the idea of elections and a legislative assembly (called the Majlis), but it wasn't until the charismatic Persian Reza Khan came along in 1923 that the idea stuck. Reza became prime minister, and later crowned himself Shah; he commenced the huge task of dragging the country into the 20th century. Iran (the name was officially adopted in 1934) was again neutral during WWII but Britain and Russia established spheres of influence there to shut out Germany. In 1941, Reza was forced into exile in South Africa and his son, Mohammad Reza, succeeded him. After the war, the USA helped persuade the Russians to leave, the young Shah regained absolute power and Iran became firmly aligned with the West.
Over the next 30 years, there was a build up of resistance to the Shah and his regime of repression and modernisation. As the economy went from bad to worse under the Shah's post oil-boom mismanagement, the growing opposition made its presence felt with sabotage and massive demonstrations. The Shah's responses became increasingly desperate and brutal, US support wavered, and he finally fled on 16 January 1979. A couple of weeks later, the acknowledged leader of the Shah's opponents, Ayatollah Khomeini, returned from exile to be greeted by adoring millions. The Ayatollah's fiery brand of nationalism and Islamic fundamentalism led to the efficient establishment of a clergy-dominated Islamic Republic, where the USA was styled as the 'Great Satan' and Israel fared not much better.
Not long after the Ayatollah was proclaimed Imam (leader), Iraqi President Saddam Hussein made an opportunistic land grab in Khuzestan province. It was a disastrous move, embroiling the two countries in a hideous war that killed hundreds of thousands before an unsatisfactory ceasefire was negotiated in 1988. The Western powers and the USSR supported Iraq, using 'lesser of two evils' logic, and weapons were only sold to Iran at vastly inflated prices.
On 4 June 1989, Ayatollah Khomeini died, leaving an uncertain legacy. Two months later Hojjat-ol-Eslam Rafsanjani was elected president, a post which had previously been largely ceremonial, and Khomeini's position as Supreme Leader was taken by the former president, Ayatollah Ali Khamenei. A trade embargo was implemented against Iran by the USA, who alleged that Iran had sponsored terrorist groups throughout the region and destabilised the peace process in the Middle East.
Following the landslide 1997 election of the moderate Iranian President Mohammad Khatami, many hoped that relations with the outside world would improve. However, relations with Germany (and most of Europe) hit rock bottom in 1997 after a German court ruled that the Iranian government had been involved in the assassination of Iranian Kurds in Germany several years earlier. Iran's international position was further destabilised when the US president George W. Bush lumped it into his 'axis of evil'.
Khatami's re-election encouraged Iranian reformers, but real power still remained with the Islamic clerics despite reformist rumblings and international pressure. In the 2004 elections the conservatives won control of parliament in a process marked by controversy - the hardline Council of Guardians had disqualified many reform-minded candidates prior to the poll.
The presidential poll of 2005 saw Iranian disillusionment with politicians provide a result few had predicted. Hardline Tehran mayor Mahmoud Ahmadinejad won a run-off against the pragmatic former president Rasfanjani. The new president’s fiery anti-Western rhetoric and enthusiastic support of Iran's nuclear program has severely strained relations with the West. Despite requests by the International Atomic Energy Agency and several foreign governments, Iran seems determined to pursue the nuclear program.
Meanwhile, in late 2003 the country was hit by one of the catastrophic earthquakes to which it has historically been prone. Centred around the city of Bam in southeastern Iran, it killed more than 31,000 people and left the city in ruins.