When David heard that the Philistines were fighting against Keilah and looting the threshing floors, he inquired of the LORD, asking, "Shall I go and attack these Philistines?" The LORD answered, "Go, attack the Philistines and save Keilah."
But David's men said to him, "Here in Judah we are afraid. How much more, then, if we go to Keilah against the Philistine forces!"
Once again David inquired of the LORD, and the LORD said, "Go down to Keilah, for I am going to give the Philistines into your hand."
So David and his men went to Keilah, fought the Philistines, carried off their livestock, inflicted heavy losses on them, and saved the people of Keilah.
(Now Abiathar, son of Ahimelech, had brought the ephod down with him when he fled to David at Keilah.)
When Saul heard that David had gone to Keilah, he said, "God has handed him over to me, for David has imprisoned himself by entering a town with gates and bars."
Saul called up all his forces to go down to Keilah to besiege David and his men.
When David learned that Saul was plotting against him, he said to Abiathar the priest, "Bring the ephod."
David said, "O LORD, God of Israel, your servant has heard definitely that Saul plans to come to Keilah and destroy the town on account of me. Will the citizens of Keilah surrender me to him? Will Saul come down, as your servant has heard? O LORD, God of Israel, tell your servant."
And the LORD said, "He will."
Again David asked, "Will the citizens of Keilah surrender me and my men to Saul?" The LORD said, "They will."
So David and his men, about six hundred in number, left Keilah and kept moving from place to place. When Saul heard that David had escaped from Keilah, he did not go there.
David stayed in the desert strongholds and in the hills of the Desert of Ziph. Day after day, Saul searched for him, but God did not give David into his hands.
While David was at Horesh in the Desert of Ziph, he learned that Saul had come out to take his life. Saul's son Jonathan went to David at Horesh and helped him find strength in God.
"Don't be afraid," Jonathan said. "My father Saul will not lay a hand on you. You will be king over Israel, and I will be second to you. Even my father Saul knows this."
The two of them made a covenant before the LORD. Then Jonathan went home, but David remained at Horesh.
The Ziphites went up to Saul at Gibeah and said, "Is not David hiding among us in the strongholds at Horesh, on the hill of Hakilah, south of Jeshimon? Now, O king, come down whenever it pleases you, and we will be responsible for handing him over to you."
Saul replied, "The LORD bless you for your concern for me. Go and make further preparation. Find out where David usually goes and who has seen him there. They tell me he is very crafty. Find out all the hiding places he uses and come back to me with definite information. Then I will go with you; if he is in the area, I will track him down among all the clans of Judah."
So they set out and went to Ziph ahead of Saul. David and his men were in the Desert of Maon, in the Arabah south of Jeshimon.
Saul and his men began the search, and when David was told about it, he went down to the rock and stayed in the Desert of Maon. Saul pursued him, going along one side of the mountain, while David and his men hurried along the other side to escape.
As Saul and his forces were closing in on David and his men, a messenger came to Saul, saying, "Come quickly! The Philistines are raiding the land."
Then Saul broke off his pursuit of David and went to meet the Philistines. That is why they call this place Sela Hammahlekoth.
From there, David went up and lived in the strongholds of En Gedi.
