According to ancient Greek historians, Median king Deiokes fortified a palace here in 728 BC, and over succeeding decades the Median capital of Ecbatana grew into an opulent city. Its massive walls were said to have had seven layers, the inner two coated in gold and silver, the outer one as long as that of classical Athens. By 550 BC it had fallen to the Achaemenid Persians, and King Cyrus was using it for his summer court.
The Medes retook the city in 521 BC but were kicked out again within six months by Darius who was so pleased with himself that he recorded his achievements in stone beside the Royal Road at Bisotun.
After centuries of wealth and pre-eminence under Parthian and Sassanian dynasties alike, Ecbatana/Hamadan faded somewhat after the Arab conquest in the mid-7th century AD, but it became the regional capital under the Seljuks for some 60 years in the late 12th century. Known as Hegmataneh (Meeting Place of Sufis) in Old Persian, Hamadan suffered the usual devastations by Mongols (1220) and Tamerlane (1386), but only hit a major decline in the 18th century following a Turkish invasion. It began to recover in the mid-19th century and was totally redesigned to a modern city plan in 1929 by German engineer Karl Frisch.