Like any political leader, David faced considerable opposition—especially as he assumed leadership of the emergent Israelite nation. He had to make tough decisions, and he had to convince his people that they were good decisions. According to author Gary A. Rendsburg, one way David and his royal scribes did this was by rewriting history, that is, by retelling the ancient stories of Genesis in such a way that they offer justification for David’s own actions. When the story of David and, later, Solomon is read in light of Genesis, the kings’ most controversial actions suddenly seem understandable; many even receive divine approval.

Here’s a summary of some of the challenges faced by David and Solomon, and the justification given in the Book of Genesis for their actions:

What David and Solomon Faced

1. David establishes the monarchy despite opposition from traditionalists, who believe God alone may reign as king.

2. Jerusalem—previously not an Israelite city—is established as capital.

3. David pushes the borders of his kingdom, engaging in battle with the neighboring states.

4. The nations of Ammon, Moab and Edom come under David’s hegemony.

5. David permits the local Canaanite priest and king Zadok (also known as Araunah, “the Lord”) to retain the title of high priest—a move that is sure to incense more conservative worshipers.

6. Solomon’s Temple becomes the center of Israelite worship—presumably in the face of opposition of those who must now travel a great distance to make sacrifices in Jerusalem.

7. David and Solomon—both younger sons—become king in the place of their elder brothers, in direct conflict with long-standing Near Eastern practices of primogeniture.

8. David commits adultery with Uriah’s wife, Bathsheba, and is tricked into admitting his guilt; he is subsequently forgiven.

Genesis’s Justification

1. The establishment of the monarchy is endorsed by the highest power—God himself, who promises David’s ancestor Abraham: “Kings will issue from you” (Genesis 17:6).

2. One of the four rivers of Eden, the place where civilization began, shares its name with Jerusalem’s Gihon spring, around which David builds his city.

3. David’s military expansion fulfills God’s promise to give Abraham’s heirs the land “from the river of Egypt to the great river, the Euphrates” (Genesis 15:18).

4. The ancestors of the three nations are recognized as close relatives of the patriarchs. Ammon and Moab are depicted as sons of Lot and his daughters, while Esau, or Edom, is the brother of Jacob.

5. Abraham presents a tithe to Melchizedek, the local priest of ancient Salem, or Jerusalem.

6. The only sacrifice Abraham ever makes—the burnt ram offered in place of Isaac—takes place on Mt. Moriah or the mount of the Lord, usually identified as Jerusalem.

7. Abel supersedes Cain, Isaac supersedes Ishmael, Jacob supersedes Esau, Judah and Joseph supersede their older brothers, Perez supersedes Zerah, Ephraim supersedes Manasseh, and Moses supersedes Aaron.

8. Judah sleeps with his daughter-in-law, Tamar, and is tricked into admitting his guilt; Judah is forgiven.