2 Samuel 5:17–25
17 When the Philistines heard that David had been anointed king over Israel, all the Philistines went up to search for David. But David heard of it and went down kto the stronghold. 18 Now the Philistines had come and spread out in lthe Valley of Rephaim. 19 And David minquired of the Lord, “Shall I go up against the Philistines? Will you give them into my hand?” And the Lord said to David, “Go up, for I will certainly give the Philistines into your hand.” 20 And David came to Baal-perazim, and David defeated them there. And he said, “The Lord has broken through my enemies before me like a breaking flood.” nTherefore the name of that place is called Baal-perazim.3 21 And the Philistines left their idols there, and David and his men carried them away.
22 And the Philistines came up yet again oand spread out in the Valley of Rephaim. 23 pAnd when David inquired of the Lord, he said, “You shall not go up; go around to their rear, and come against them opposite the balsam trees. 24 And qwhen you hear the sound of marching in the tops of the balsam trees, then rouse yourself, rfor then the Lord has gone out before you to strike down the army of the Philistines.” 25 And David did as the Lord commanded him, and struck down the Philistines from Geba sto Gezer.