The kingdom of Judea (Judah) maintained its capital at Jerusalem until 586 BC, when the Babylonians destroyed the Temple, ended the kingdom, and transferred the leadership and much of the Jewish population in exile to Babylon. Under Cyrus of Persia, the Jews were allowed to return to Jerusalem, and the rebuilding of the Temple began.
Historical Dictionary of Israel. Bernard Reich David H. Goldberg. Edited by Jon Woronoff..