1 Samuel 23:7-18
Now it was told Saul that David had come to Keilah. And Saul said, "God has given him into my hand; for he has shut himself in by entering a town that has gates and bars." Saul summoned all the people to war, to go down to Keilah, to besiege David and his men.
When David learned that Saul was plotting evil against him, he said to the priest Abiathar, "Bring the ephod here." David said, "O LORD, the God of Israel, your servant has heard that Saul seeks to come to Keilah, to destroy the city on my account. And now, will Saul come down as your servant has heard? O LORD, the God of Israel, I beseech you, tell your servant." The LORD said, "He will come down."
Then David said, "Will the men of Keilah surrender me and my men into the hand of Saul?" The LORD said, "They will surrender you." Then David and his men, who were about six hundred, set out and left Keilah; they wandered wherever they could go. When Saul was told that David had escaped from Keilah, he gave up the expedition. David remained in the strongholds in the wilderness, in the hill country of the Wilderness of Ziph. Saul sought him every day, but the LORD did not give him into his hand.
David Eludes Saul in the Wilderness
David was in the Wilderness of Ziph at Horesh when he learned that Saul had come out to seek his life. Saul's son Jonathan set out and came to David at Horesh; there he strengthened his hand through the LORD. He said to him, "Do not be afraid; for the hand of my father Saul shall not find you; you shall be king over Israel, and I shall be second to you; my father Saul also knows that this is so." Then the two of them made a covenant before the LORD; David remained at Horesh, and Jonathan went home.