David Conquers the Philistines

2 Samuel 5:17–25

17 But when the Philistines heard that they had anointed David king over Israel, all the Philistines came up to seek David; and David heard of it, and went down to the hold.
18 The Philistines also came and spread themselves in the valley of Rephaim.
19 And David inquired of the Lord, saying, Shall I go up to the Philistines? wilt thou deliver them into mine hand? And the Lord said unto David, Go up: for I will doubtless deliver the Philistines into thine hand.
20 And David came to Baal-perazim, and David smote them there, and said, The Lord hath broken forth upon mine enemies before me, as the breach of waters. Therefore he called the name of that place Baal-perazim.
21 And there they left their images, and David and his men burned them.
22 And the Philistines came up yet again, and spread themselves in the valley of Rephaim.
23 And when David inquired of the Lord, he said, Thou shalt not go up; but fetch a compass behind them, and come upon them over against the mulberry trees.
24 And let it be, when thou hearest the sound of a going in the tops of the mulberry trees, that then thou shalt bestir thyself: for then shall the Lord go out before thee, to smite the host of the Philistines.
25 And David did so, as the Lord had commanded him; and smote the Philistines from Geba until thou come to Gazer.

Dr. Ellis T. Rasmussen wrote:

“When all the Philistines realized what some rulers of their city-states had anticipated (1 Sam. 29:4–9), they attacked Israel through the valley of Rephaim, which runs eastward toward Jerusalem. With the guidance of the Lord, David drove them back, first by a frontal assault and then by a surprise attack from the rear. He eventually controlled the Philistines even more completely than had Saul, and he restrained them as in the early part of Samuel’s administration.”

(A Latter-day Saint Commentary on the Old Testament [1993], 260.)