The presence of a Jewish community in Iran dates back to the period of the first Achaemenian conquests and the capture of Babylon by Cyrus the Great, the Achaemenid ruler, in 539 BC. The religious tolerance shown by Cyrus to the Jewish people, is remembered on two counts: Cyrus freed the Jews who had been deported to Babylon by Nebuchadnezzar and gave them permission to return to Jerusalem and rebuild their temple there. At that time, Jerusalem was placed under Persian administration.
There were at least two Jewish consorts of Iranian kings: the biblical Esther whose story is depicted in the III century AD synagogue murals from Dura Europos (National Museum, Damascus) and who is said to be buried in Hamadan; or the tomb that they found there could be that of the second Jewish consort, of the Sassanid shah Yazdigird I.
Later Sassanid rule saw persecution of both the Jews and Christians, but generally speaking the community was protected in early Islam because of its legal status and trading connections. Life became much harder later, especially during the Safavid and Qajar regimes, although there was some respite under Nadir Shah Afshar. Pogroms, especially in Mashhad in 1839, led the community to ask for British protection and many fled to Herat (Afghanistan), only to be forcibly repatriated in 1856. When opportunities arose, many travelled northwards into Central Asia and west into Ottoman lands, as well as migrated to the USA.
The 1966 census showed some 60,000 Jews still residing in Iran, mainly in Tehran, Esfahan and Hamadan, but since the establishment of the Iranian Republic perhaps less than half remain; in Hamadan for instance only 47 Jews were recorded in the 1996 census.