History of ancient Israel and Judah
In 586 BCE, the Babylonians, under king Nebuchadnezzar II captured Jerusalem, destroyed the Temple of Solomon, ended the Davidic kingship, and carried the people into captivity. Only the poorest were left behind in Judah, now the Babylonian province of Yehud with its capital at Mizpah in the former territory of Benjamin, north of Jerusalem. A few years later, again according to the bible, the governor of Yehud was murdered by rivals, triggering another exodus of refugees, this time to Egypt. Thus by about 580 the people of Judah were to be found in three separate locations, the elite in Babylon (where, incidentally, they appear to have been well treated), a large community in Egypt, and a remnant in Judah. The Exile ended when Cyrus the Great of Persia conquered Babylon (traditionally 538 BCE). The Persians reconstituted Judah/Yehud as a province ("Yehud medinata") within the satrapy "Beyond the River", and over the following century some of the exiles returned to Jerusalem. There they eventually rebuilt the Temple (traditionally 516/515 BCE), but for over a century the administrative capital remained at Mizpah. Samaria, meanwhile, continued as the province of Semarina within the same satrapy as Yehud.