So David prevailed over the Philistine with a sling and with a stone, and struck the Philistine, and killed him; but there was no sword in the hand of David.
This is no difficulty whatever, being merely the way the Biblical narratives are written with much redundancy and repetition.  Another example is the case of Jael's killing Sisera.  After the enemy was already lying there with his head nailed to the ground with a tent-pin driven though his temples, the narrative states that, "He was in a deep sleep, and swooned and died"  (Judges 4:21, ASV)!  This is merely the way that ancient historians wrote.