17 When the Philistines heard that David had been made king over Israel, all the Philistines went to look for him. But when David heard the news, he went down to the stronghold.
18 The Philistines came and camped in the Valley of Rephaim.
19 David asked the Lord, “Should I attack the Philistines? Will you hand them over to me?”The Lord said to David, “Go! I will certainly hand them over to you.”
20 So David went to Baal Perazim and defeated the Philistines there. David said, “Like a flood of water, the Lord has broken through my enemies in front of me.” So David named the place Baal Perazim.
21 The Philistines left their idols behind at Baal Perazim, so David and his men carried them away.
22 Once again the Philistines came and camped at the Valley of Rephaim.
23 When David prayed to the Lord, he answered, “Don’t attack the Philistines from the front. Instead, go around and attack them in front of the balsam trees.