5 17 When the Philistines heard that David had been anointed king over Israel, all the Philistines went up in search of David; but David heard of it and went down to the stronghold. 5 18 Now the Philistines had come and spread out in the valley of Rephaim. 5 19 And David inquired of Yahweh, "Shall I go up against the Philistines? Will you give them into my hand?" And Yahweh said to David, "Go up; for I will certainly give the Philistines into your hand." 5 20 And David came to Baal-perazim, and David defeated them there; and he said, "Yahweh has broken through my enemies before me, like a bursting flood." Therefore the name of that place is called Baal-perazim. 5 21 And the Philistines left their idols there, and David and his men carried them away.
5 22 And the Philistines came up yet again, and spread out in the valley of Rephaim. 5 23 And when David inquired of Yahweh, he said, "You shall not go up; go around to their rear, and come upon them opposite the balsam trees. 5 24 And when you hear the sound of marching in the tops of the balsam trees, then bestir yourself; for then Yahweh has gone out before you to smite the army of the Philistines." 5 25 And David did as Yahweh commanded him, and smote the Philistines from Geba to Gezer.