17 The Philistines were told that David had been made king of Israel, so their army set out to capture him. When David heard of it, he went down to a fortified place.
18 The Philistines arrived at Rephaim Valley and occupied it.
19 David asked the Lord, “Shall I attack the Philistines? Will you give me the victory?”“Yes, attack!” the Lord answered. “I will give you the victory!”
20 So David went to Baal Perazim and there he defeated the Philistines. He said, “The Lord has broken through my enemies like a flood.” And so that place is called Baal Perazim.
21 When the Philistines fled, they left their idols behind, and David and his men carried them away.
22 Then the Philistines went back to Rephaim Valley and occupied it again.
23 Once more David consulted the Lord, who answered, “Don't attack them from here, but go around and get ready to attack them from the other side, near the balsam trees.