1 Samuel 27:1-7 NLT

1 But David kept thinking to himself, “Someday Saul is going to get me. The best thing I can do is escape to the Philistines. Then Saul will stop hunting for me in Israelite territory, and I will finally be safe.”
2 So David took his 600 men and went over and joined Achish son of Maoch, the king of Gath.
3 David and his men and their families settled there with Achish at Gath. David brought his two wives along with him—Ahinoam from Jezreel and Abigail, Nabal’s widow from Carmel.
4 Word soon reached Saul that David had fled to Gath, so he stopped hunting for him.
5 One day David said to Achish, “If it is all right with you, we would rather live in one of the country towns instead of here in the royal city.”
6 So Achish gave him the town of Ziklag (which still belongs to the kings of Judah to this day),
7 and they lived there among the Philistines for a year and four months.