The biblical patriarch David was the second king of ancient Israel and is traditionally regarded as the author of the Psalms. He is represented as a paradigm of monarchical righteousness, though he was not without his flaws. He was responsible for defeating the Philistines and his slaying of the giant Goliath is one of the best-known stories in the Bible. He also won huge victories over the Moabites, the Arameans, the Ammonites and the Edomites before establishing his kingdom in Jerusalem. According to Nathan the prophet, God decreed that this land was to be ruled over by David and his descendents for all eternity (2 Samuel 7:16).