17 When the Philistines heard that David had been anointed king over Israel, they all marched up to find him, but David heard of it and went down to the fortress.
18 The Philistines arrived and spread out over the Rephaim Valley.
19 David asked the Lord, "Should I attack the Philistines? Will you hand them over to me?""Attack them," the Lord replied, "because I will definitely hand the Philistines over to you."
20 So David arrived at Baal-perazim and defeated the Philistines there. He said, "The Lord has burst out against my enemies, the way water bursts out!" That is why that place is called Baal-perazim.
21 The Philistines left their divine images behind, and David and his men carried them off.
22 Once again the Philistines came up and spread out across the Rephaim Valley.
23 When David asked the Lord, God replied, "Don’t attack them directly. Circle around behind them and come at them from in front of the balsam trees.