When the Philistines heard that David was anointed king over all Israel, all the Philistines went up to seek David: and David heard of it, and went out against them.
David inquired of God, saying, Shall I go up against the Philistines? and will you deliver them into my hand? Yahweh said to him, Go up; for I will deliver them into your hand.
So they came up to Baal Perazim, and David struck them there; and David said, God has broken my enemies by my hand, like the breach of waters. Therefore they called the name of that place Baal Perazim.
David inquired again of God; and God said to him, You shall not go up after them: turn away from them, and come on them over against the mulberry trees.
It shall be, when you hear the sound of marching in the tops of the mulberry trees, that then you shall go out to battle; for God is gone out before you to strike the host of the Philistines.