1 Now the Philistines collected all their armies to Aphek. And the Israelites encamped by a fountain which is in Jezreel. 2 And the lords of the Philistines passed on by hundreds and by thousands, but David and his men passed on in the rear with Achish. 3 Then the princes of the Philistines said, "What are these Hebrews doing here?" And Achish said to the princes of the Philistines, "Is this not David, the servant of Saul the king of Israel, who has been with me these days, or these years? I have found no fault in him since he fell to me to this day." 4 And the princes of the Philistines were angry with him. And the princes of the Philistines said to him, "Make this man return so that he may go back to his place which you have appointed him, and do not let him go down with us to battle, lest in the battle he should be an adversary to us. For with what would he reconcile himself to his master? Would it not be with the heads of these men?
5 Is this not David, of whom they sang to one another in dances, saying, 'Saul slew his thousands, and David his tens of thousands'?"
6 Then Achish called David and said to him, "Surely, as the LORD lives, you have been upright, and your going out and your coming in with me in the host is good in my sight. For I have not found evil in you from the day of your coming to me to this day. Nevertheless, the lords do not favor you. 7 Now therefore, return and go in peace so that you do not displease the lords of the Philistines." 8 And David said to Achish, "But what have I done? And what have you found in your servant, so long as I have been with you to this day, that I may not go and fight against the enemies of my lord the king?" 9 And Achish answered and said to David, "I know that you are good in my sight, as an angel of God. Nevertheless, the princes of the Philistines have said, 'He shall not go up with us to the battle.' 10 Now therefore, rise early in the morning with your master's servants who have come with you. And as soon as you have risen early in the morning and have light, depart." 11 So David and his men rose early to depart in the morning, to return into the land of the Philistines. And the Philistines went up to Jezreel.
[v.5] - Reference, 1st Samuel 18:7.