Pre-Islam According to
Clifford Edmund Bosworth, "Hamadan is a very old city. It may conceivably, but improbably, be mentioned in cuneiform texts from ca. 1100BC, the time of Assyrian King
Tiglath-Pileser I, but is certainly mentioned by Herodotus who says that the king of Media Diokes built the city of
Agbatana or Ekbatana in the 7th centuryBC." Hamadan was established by the
Medes. It then became one of several capital cities of the
Achaemenid Dynasty. The biblical
book of Ezra (
Ezra 6:2) mentions Hamadan as the place where a scroll was found giving the Jews permission from King Darius to rebuild the temple in Jerusalem. Its ancient name of Ecbatana is used in the Ezra text. Because it was a mile above sea level, it was a good place to preserve leather documents. During the
Parthian era,
Ctesiphon was the capital of the country, and Hamadan was the summer capital and residence of the Parthian rulers. After the Parthians, the
Sasanians constructed their summer palaces in this city. In 642, the
Battle of Nahavand took place and Hamadan fell into the hands of the Muslim Arabs.
Early Islamic Era From the middle of the ninth century, the government of the city fell into the hands of Alavi Sadat. They ruled in Hamedan as Alawites. The valuable building of the Alavian dome is a relic of this period. In 931 AD (319 AH), Hamedan was attacked by Mard Avij, the founder of the Al-Ziyar dynasty. Because the people of Hamedan had murdered his nephew, Abu al-Karadis, along with some of the army of Daylam, Mardavij turned the city into an arena of great plunder and massacre. Mardavij threw a stone lion through the gates of the city, and as a result, one of the two unique historical statues was completely shattered, and the other still remains.
Buyid Rule During the rule of the
Buyid dynasty, the city suffered much damage. However, the city regained its former glory under the rule of the
Buyid ruler
Fanna Khusraw. The
Seljuks launched campaigns to take the city in the 1040s, ultimately taking the final Kakuyid fortress in 1047. The Seljuks later shifted their capital from
Baghdad to Hamadan. In 1220, Hamadan was destroyed by the
Mongols during the
Mongol invasions of Georgia before the
Battle of Khunan. The city of Hamadan, its fortunes following the rise and fall of regional powers, was completely destroyed during the
Timurid invasions, but later thrived during the
Safavid era.
Benjamin of Tudela reported that Hamadan had 30,000 Jews in 1170.
Ottoman takeover and return to Iranian control , made in
Ecbatana mint|right Thereafter, in the 18th century, Hamadan was surrendered to the
Ottomans, but due to the work of
Nader Shah, Hamadan was cleared of invaders and, as a result of a peace treaty between Iran and the Ottomans, it was returned to Iran; During the early 18th century chaos in Iran, various tribal groups, including
Kurdish tribes, took advantage of the instability. In 1719, Kurdish tribes temporarily seized Hamadan and advanced nearly as far as
Isfahan. Hamadan stands on the
Silk Road, and even in recent centuries the city enjoyed strong commerce and trade as a result of its location on the main road network in the western region of Iran. In the late 19th century, American missionaries, including
James W. Hawkes and Belle Sherwood Hawke, established schools in Hamadan.
World War I , a
cuneiform inscription in Hamadan During
World War I, the city was the scene of heavy fighting between Russian and Turko-German forces. It was occupied by both armies, and finally by the British, before it was returned to the control of the Iranian government at the end of the war in 1918.
Post World War At the end of the
Qajar era, the city of Hamedan witnessed two major famines with a gap of 10 years. The first was the artificial famine of Hamedan during the reign of Ali Zahir al-Dawla due to the opposition of the Khans of Hamedan to the constitutionalist ideas of Zahir al-Dawla, the ruler of Hamadan, and the second famine was during World War I and in the following years. During this war, the city of Hamedan was alternately occupied by Russian, Ottoman, and British forces, and this city was the headquarters of their armies.
Iran–Iraq War During the
Iran–Iraq War, the city of Hamedan was repeatedly targeted by Iraqi bombardments. One of the most intense bombing attacks was on Friday 16 July 1982, by Iraqi warplanes, which coincided with Quds Day. In this attack, dozens of residential houses in four districts of Hamedan city were destroyed, and 97 Hamedan citizens were killed and 595 others were injured.
2025–2026 Iranian protests During the
2025–2026 Iranian protests, protesters in Hamadan chanted "This is the final battle,
Pahlavi will return". ==Demographics==