An important historical city in the area of modern-day Tehran, now absorbed by it, is known as Ray, which is etymologically connected to the Old Persian and Avestan Ragha. The city was a major area of the Iranian speaking Medes and Achaemenids.In the Zoroastrian Avesta, Videvdad, i, 15, Ragha is mentioned as the twelfth sacred place created by Ahura-Mazda. In the Old Persian inscriptions (Behistun 2, 10–18), Ragha appears as a province. From Ragha, Darius the Great sent reinforcements to his father Hystaspes (Vishtaspa), who was putting down the rebellion in Parthia (Behistun 3, 1–10).The Damavand mountain located near the city also appears in the Shahnameh as the place where Freydun bounds the dragon-fiend Zahhak. Damavand is important in Persian mythological and legendary events. Kayumarrt, the Zoroastrian prototype of human beings and the first king in the Shahnameh, was said to have resided in Damavand. In these legends, the foundation of the city of Damavand was attributed to him. Arash, the archer who sacrificed his body by giving all his strength to the arrow that demarcated Iran and Turan, shot his arrow from Mount Damavand. This Persian legend was celebrated every year in the Tiregan festival. A popular feast is reported to have been held in the city of Damavand on 7 Sawwal 1230, or in Gregorian calendar, 31 August 1815. During the alleged feast the people celebrated the anniversary of Zahhak’s death. In the Zoroastrian legends, the tyrant Zahhak is to finally be killed by the Iranian hero Garsasp before the final days In some Middle Persian texts, Ray (Ragha) is given as the birthplace of Zoroaster although modern historians generally place the birth of Zoraster in Khorasan. In one Persian tradition, the legendary king Manucehr was born in Damavand.
During the Sassanid era, Yazdegerd III in 641 issued from Ray his last appeal to the nation before fleeing to Khorasan. The sanctuary of Bibi Shahr-Banu situated in modern Tehran spur and accessible only to women is associated with the memory of the daughter of Yazdegerd who, according to tradition, became the wife of al-Husayn b. Ali, the third Shi’ite Imam. Ray was the fief of the Parthian Mihran family and Siyavakhsh the son of Mihran the son of Bahram Chobin resisted the Arab invasion. Because of this resistance, when the Arabs captured Ray, they ordered the town to be destroyed and ordered Farrukhzad to rebuild the town.In the 10th century, Ray is described in detail in the work of Islamic geographers. Despite the interest of Baghdad displayed in Ray, the number of Arabs there was insignificant, and the population consisted of Persians of all classes. The Ghuzz Turks laid Ray to waste in 1035 and in 1042, but the city recovered during the Saljuqid and Khwarazmian era. The Mongols laid Ray to complete waste and according to Islamic historians of the era, virtually all of its inhabitants were massacared. The city is mentioned in later Safavid chronicles as an unimportant city.
The origin of the name Tehran is unknown. Tehran was well known as a village in the 9th century, but was less well-known than the city of Rhages (Ray) which was flourishing nearby in the early era. Najm al-Din Razi known as Dayya gives the population of Ray as 500,000 before the Mongol invasion. In the 13th century, following the destruction of Ray by Mongols, many of its inhabitants escaped to Tehran. In some sources of the early era, the city is mentioned as “Rhages’s Tehran”. The city is later mentioned in Hamdollah Mostowfi’s Nuz’hat al-Qulub (written in 1340) as a famous village.
There is also a shrine there, dedicated to commemorate Princess Shahr Banu, eldest daughter of the last ruler of the Sassanid Empire. She gave birth to Ali Zayn al Abidin, the fourth holy Imam of the Shia faith. This was through her marriage to Husayn ibn Ali, the grandson of Muhammad, the prophet of Islam. A nearby mountain is also named after her. However, some sources attribute the shrine to the goddess of water and fertility, Anahita, claiming it was renamed in Islamic times to protect it from any possible harm after the conversion of Iranians to Islam.Don Ruy Gonzáles de Clavijo, a Castilian ambassador, was probably the first European to visit Tehran, stopping in July 1404, while on a journey to Samarkand (now in Uzbekistan) the capital of Timur, who ruled Iran at the time. At this time, the city of Tehran was unwalled.
In the early 18th century, Karim Khan Zand ordered a palace, and a government office to be built in Tehran, possibly to declare the city his capital, but later moved his government to Shiraz. Tehran finally became the capital of Iran in 1795, when the Qajar king Agha Mohammad Khan was crowned in the city. It remains the capital to this day.In the 1920s and 30s, the city essentially was rebuilt from scratch under the rule of the Shah of Iran, Reza Shah Pahlavi. Reza Shah believed that ancient buildings such as large parts of the Golestan Palace, Takieh-ye Dowlat, the Toopkhaneh Square, the city fortifications and the old citadel among others should not be part of a modern city. They were systematically destroyed and modern buildings in the pre-islamic Iranian style, such as the National Bank, the Police Headquarters, the Telegraph Office and the Military Academy were built in their place. The Tehran Bazaar was divided in half and many historic buildings were destroyed in order to build wide straight avenues in the capital. Many Persian gardens also fell victim to new construction projects.
During World War II, Soviet and British troops entered the city. Tehran was the site of the Tehran Conference in 1943, attended by U.S. President Franklin D. Roosevelt, Soviet Premier Joseph Stalin, and British Prime Minister Winston Churchill.In the 1960s and 70s Tehran was rapidly developing under the reign of Shah Mohammad Reza Pahlavi. Modern buildings altered the face of Tehran and ambitious projects were envisioned for the following decades. The majority of these projects were continued after the Islamic revolution of 1979 when Tehran’s urbanization had reached its peak, and the new government started many other new projects, such as Milad Tower.
During the 1980–88 Iran–Iraq War, Tehran was the target of repeated Scud missile attacks and air strikes