Cyrus, the prince of Anshan and ruler of the recently united Medo-Persian Empire, captured the city of Babylon in October of 539 b.c. The ancient world, and the Jewish expatriates living in Babylon in particular, would never be the same again. Cyrus immediately released the exiles and charged them to return to Jerusalem to rebuild the temple (Ezr 1:1-4). Approximately fifty thousand Jews returned under the civil leadership of Zerubbabel (governor of the satrapy known as Yehud) and the religious leadership of Joshua (the high priest). At this point, progress on the temple was modest. The foundation was repaired and the altar rebuilt in 537 b.c. (Ezr 3). But the early restoration community labored under unfavorable conditions, racial opposition being primary among them. They were also small in number. Many of the Jews had acclimated well to their exile and had become successful in their new surroundings. Jerusalem was in a shambles, was sparsely populated, and seemed uninviting to many Jews comfortably settled in Babylonia. Lacking resources and energy for the task, work on reconstruction soon came to a complete stop (Ezr 4:1-5; 24).
Cyrus died in battle in 530 b.c. and was succeeded by his son Cambyses II. The new Persian ruler successfully added Egypt to the growing empire in 525. But Cambyses' reign was not so secure as his father's, and he feared any threat to his authority. Bardiya, his brother, was so popular with the people that Cambyses had him assassinated. While in Palestine in 522 B.C., Cambyses received news of revolt at home. His death near Mount Carmel is locked in mystery, but we may assume that he was the victim of murder or suicide.
An officer of the army, Darius Hystaspes, claimed the throne in the midst of political revolution. Unrest was widespread early in his reign, but Darius apparently established firm control of the empire by 520 b.c. His policy of tolerance and the stability of his reign created favorable conditions that made it possible for the Jews to resume work on the temple. Darius, in fact, confirmed the original decree of Cyrus and provided royal resources for the temple project (Ezr 6:1-10). Under the local leadership of Zerubbabel and Joshua, the work was resumed in September of 520 b.c. (Hag 1:14-15). This is the context in which Haggai and Zechariah ministered to the Jews of Jerusalem. Their date formulae (Hag 1:1, 15; 2:1, 10, 20; Zec 1:1, 7; 7:1) place much of their ministry specifically between August of 520 and December of 518 b.c.