1 Samuel 27
And David said in his heart, I shall now perish one day by the hand of Saul: there is nothing better for me than that I should speedily escape into the land of the Philistines; and Saul shall despair of me, to seek me any more in any coast of Israel: so shall I escape out of his hand.
2 And David arose, and he passed over with the six hundred men that were with him unto Achish, the son of Maoch, king of Gath.
3 And David dwelt with Achish at Gath, he and his men, every man with his household, even David with his two wives, Ahinoam the Jezreelitess, and Abigail the Carmelitess, Nabal's wife.
4 And it was told Saul that David was fled to Gath: and he sought no more again for him.
5 And David said unto Achish, If I have now found grace in thine eyes, let them give me a place in some town in the country, that I may dwell there: for why should thy servant dwell in the royal city with thee?
6 Then Achish gave him Ziklag that day: wherefore Ziklag pertaineth unto the kings of Judah unto this day.
7 And the time that David dwelt in the country of the Philistines was a full year and four months.
8 And David and his men went up, and invaded the Geshurites, and the Gezrites, and the Amalekites: for those nations were of old the inhabitants of the land, as thou goest to Shur, even unto the land of Egypt.
9 And David smote the land, and left neither man nor woman alive, and took away the sheep, and the oxen, and the asses, and the camels, and the apparel, and returned, and came to Achish.
10 And Achish said, Whither have ye made a road to day? And David said, Against the south of Judah, and against the south of the Jerahmeelites, and against the south of the Kenites.
11 And David saved neither man nor woman alive, to bring tidings to Gath, saying, Lest they should tell on us, saying, So did David, and so will be his manner all the while he dwelleth in the country of the Philistines.
12 And Achish believed David, saying, He hath made his people Israel utterly to abhor him; therefore he shall be my servant for ever.
Public Domain KJV text from Wordproject.org
Although the Lord has protected David from every danger so far, his faith is tried once again. His prospects are dark. His own people show only censure and ingratitude. The men of Keilah try to turn him over to Saul, and the Ziphites twice tell Saul of his hiding places. He is being treated as an outlaw.
So, without asking guidance from the Lord, he decides to take refuge among the Philistines, sworn enemies of his people. Achish, king of Gath welcomes him. This seems to be the same king before whom David had feigned madness. Achish apparently sees David and his band as a help to his own military forces. When Saul hears where David has gone, he decides to stop pursuing him.
David’s failure in this case is similar to the flight of Elijah after his victory on Mt. Carmel. Both David and Elijah suffer an all-too-human lack of faith and courage. Fortunately God does not abandon either. David’s blunder in fleeing to the Philistines without God’s guidance and then covering the truth about his raids with duplicity shows again that there is safety only in following God’s will.