Now when the Philistines heard that David had been anointed king over all Israel, all the Philistines went up to search for David. And David heard [of it] and went out against them.
And David inquired of God, saying, "Shall I go up against the Philistines? Will You deliver them into my hand?" And the LORD said to him, "Go up, for I will deliver them into your hand."
So they went up to Baal Perazim, and David defeated them there. Then David said, "God has broken through my enemies by my hand like a breakthrough of water." Therefore they called the name of that place Baal Perazim.
Therefore David inquired again of God, and God said to him, "You shall not go up after them; circle around them, and come upon them in front of the mulberry trees.
"And it shall be, when you hear a sound of marching in the tops of the mulberry trees, then you shall go out to battle, for God has gone out before you to strike the camp of the Philistines."