In 586 BC the Babylonians sacked Jerusalem, destroyed the temple, and took most of the Jews into exile. About 50 years later Cyrus, the Persian, took Babylon, and brought the Babylonian Empire to an end. The next year (538 BC) he allowed the Jews to return to their homeland and rebuild the temple at Jerusalem. Those who returned started to rebuild in 536. They rebuilt the altar and then stopped. In 520 BC Haggai confronted them about the temple rebuilding project.