this messianic hope for a restored judean kingdom under the leadership of the royal house of david seemed to have been vindicated when cyrus the great , after conquering babylon in 539 bce , permitted a repatriation of subject populations and a restoration of local temples .