Ancient Mesopotamia consisted of independent city-states each with their own ruler, with patriarchal societies dominated by men. Hammurabi established the first written law code in Babylon based on strict justice that varied by social class. Ancient Egypt developed along the Nile River, with pharaohs believed to have divine kingship and their rule evolving from the Old to New Kingdoms and eventual collapse of their large empire. The Israelites originated as a united kingdom under King Solomon in Palestine, which later split into the kingdoms of Israel and Judah after his death.