2 Samuel 22


Our narrator is wrapping up the story of David, who became king of God’s people in place of Saul and who faced many challenges and troubles and trials during his lifetime. But the Lord preserved him and kept him. And some time during his reign, David wrote this song of thanksgiving to the Lord which appears in today’s chapter. The same song of thanksgiving — with some minor modifications — also appears in the psalms. It’s Psalm 18.

And you’ll see from verse 1 that David sang the words of this song or psalm when the Lord delivered him from the hand of all his enemies and from the hand of Saul. Saul is mentioned specifically; but, as we’ve seen, David faced many enemies, didn’t he? When he was only a boy, minding his father’s sheep, he had to fight against lions and bears. Then he fought against Goliath the giant. Though Saul once loved David, Saul later grew jealous of David and tried several times to kill him so that David had to flee for his life and he remained on the run for years. Then, after David became king, his son Absalom conspired against him so that David was forced once again to flee from Jerusalem. And after Absalom’s death, when David returned to Jerusalem, that man Sheba rebelled against him. And, of course, throughout his reign, David and his men had to fight against the Philistines and the other pagan nations who were still living in the Promised Land at that time. So, throughout his life, David faced many enemies. And yet the Lord delivered him again and again and again. And therefore, at some point in his reign, he wrote this song or psalm of thanksgiving to express his gratitude to the Lord for helping him.

Most of the commentators make the point that this song at the end of 2 Samuel recalls Hannah’s prayer at the beginning of 1 Samuel. So, in her prayer, Hannah prayed about the coming king and how the Lord would give him strength. That means she was looking ahead to what the Lord would do in the future for the king. And now, towards the end of his life, David the king looks back on what the Lord has done for him and he gives thanks to the Lord for giving him the strength he needed to overcome his enemies. So, what we read here in this chapter recalls Hannah’s prayer and they match one another.

And the commentators also make the point that David’s song of thanksgiving is a reminder to us that all of his success was due, not to his own skill or strength or ability, and it was not due to good fortune or luck, but it was due to the Lord who rescued him from danger and who helped him continually. And so, this song is a kind of theological reflection on everything we’ve read in 1 and 2 Samuel about David’s life. Instead of boasting about himself, David boasted in the Lord, who gave him the victory.

However, as we’ve seen before, what happened to David in the lifetime foreshadows what would happen to the Lord Jesus Christ, who is King David’s greater son. And so, while this song of thanksgiving is clearly about David and how the Lord rescued him from deadly danger and helped him to triumph over his enemies, it’s also about the Lord Jesus who was rescued from the grave and exalted over his enemies to rule from heaven as king over all. This will become clear when we see how some of what David says in this song of thanksgiving does not fit his life. And so, we believe that David wrote this song as a prophet to foretell the coming of the Lord Jesus Christ, who is God’s True Anointed King and our Saviour.


And so, I want to go through this song of thanksgiving fairly quickly to show how it applies to David. And then I’ll show how it applies to Christ. And then I’ll also show how it applies to believers.

And the song’s opening is verses 2 to 4 where David confesses that the Lord his God is his rock and fortress and deliverer; and his rock in whom he takes refuge and his shield and the horn of his salvation; and his stronghold and refuge and saviour. The phrase ‘horn of my salvation’ signifies God’s strength and power and his ability to save his people from danger. And all of these words describe how the Lord protects and guards and defends and shelters his people and he delivers them from trouble. ‘I call to the Lord’, David says in verse 4, ‘and I am saved from my enemies.’ And therefore he confesses that God is worthy of praise, because he is all of this and more to his people who trust in him.

In verses 5 to 7 he uses the imagery of drowning to convey to us the deadly danger he was in. So, the waves of death swirled about him and the torrents of destruction overwhelmed him. And it seems that death had got hold of him with its cords and was dragging him down, down, down, closer to the grave. And death was like a snare into which he was about to fall. And just as a drowning man will call out for help, so David called out for help. ‘In my distress’, he says in verse 7, ‘I called to the Lord.’ And the Lord — from his heavenly temple — heard his voice. And the Lord not only heard his voice, but the Lord came down from heaven to save him.

And so, in the following verses — verses 8 to 20 — he describes how the Lord came to his rescue. So, the earth trembled and quaked and the foundations of the heavens shook. In other words, heaven and earth trembled because the Lord was angry at what was happening to David. David refers to smoke and fire and burning coals to convey God’s anger. In verse 10 he says God parted the heavens, just as we would pull open a set of curtains, and the Lord came down from heaven with the clouds and the angels. There was thunder and lightning. The depths of the sea and the foundations of the mountains were laid bare and exposed. And then the Lord reached down and he took hold of David and drew him out of the deep waters. In other words, he rescued David from whatever deadly danger he was in. Once he was boxed in. There was no escape. There was no way out. But then, suddenly, the Lord lifted him away from the danger and brought him into a spacious place, into the open countryside, where everything was peaceful and quiet and safe. God rescued him, because God delighted in him.

In this song or psalm of thanksgiving, David uses poetic language to make the point that God saved him. And you can perhaps think back over what we’ve read about David’s life in the books of 1 and 2 Samuel and you can remember some of the occasions when David’s life was in danger and God rescued him. There was that time in 1 Samuel 23 where Saul’s men were closing in on David’s men, who were on the other side of a mountain. Saul’s men were about to reach David’s men and then it would have been all over for David. But, just as Saul was catching up, a messenger came to Saul to tell him that the Philistines were attacking Israel in another place and Saul had to come away urgently to deal with the Philistines. David’s life was in danger, but the Lord — his rock and refuge and deliverer — saved him. He saved him on that day and he saved him again and again and again throughout his life.

Let’s jump over verses 21 to 31 for the time being and move directly to verses 33 to 46 where David again describes how the Lord helped him. But there’s an advancement in these verses over what he said in verses 5 to 20. The emphasis in verses 5 to 20 is on defence. David was in deadly danger and God rescued him. The emphasis in verses 32 to 46 is on offence. God helped him to conquer the pagan nations.

And so, in verse 33 God armed him with strength. He made his feet like the feet of a deer to enable him to stand on the heights. And he trained him for battle and shielded him from danger and the Lord stooped down from heaven to make David great. According to verse 37 he prepared the way for David so that he did not stumble or fall. And so, with God’s help, he was able to pursue his enemies and he crushed them. He destroyed them so that they could not rise. Remember, of course, that these were pagan nations: people who did not worship the Lord and who lived wicked lives. And so, God sent David to punish them on his behalf. According to verse 40 God armed David with strength for the battle and the Lord made his adversaries bow at his feet. So, there’s David making clear that whatever success he had was due, not to his own skill or strength, and not to good fortune or luck, but it was due to the Lord who helped him. Verse 41: You made my enemies turn their backs in flight. When they cried for help, there was no one to help them, because the Lord was against them.

And so, according to verse 44, the Lord delivered him from the attacks of ‘my people’. Notice he says ‘my people’, because at times David faced attacks from his own people: from Saul, for instance, and from Absalom his son and from Sheba. But the Lord delivered him. And the Lord preserved him as the head of the nations. God gave him victory over the Philistines and the other pagan nations who were living in the Promised Land at that time. People he did not know — foreigners from the other nations — became subject to him. They submitted to him as their king.

And the song ends in verses 47 to 51 with praise to God again. The Lord lives. Praise be to my rock. Exalted be God, the rock, my Saviour. He avenges me and he puts nations under me and he sets me free from my enemies. Therefore I will praise you, O Lord, among the nations. I will sing praises to your name.


And so, you read through this song of thanksgiving and it clearly applies to David, because the Lord rescued him again and again from deadly danger and the Lord gave him victory over his enemies.

However, let’s go back to verses 21 to 31, because this part of the song doesn’t fit with David. In verse 21 he says:

The Lord has dealt me with according to my righteousness;
according to the cleanness of my hands he was rewarded me.
For I have kept the ways of the Lord;
I have not done evil by turning from my God.
All his laws are before me;
I have not turned away from his decrees.
I have been blameless before him
and have kept myself from sin.

You read those words of David and you want to say to him: Really, David? Really? Have you really been blameless and have you really kept yourself from sin? What about Bathsheba and her husband Uriah? Remember how you committed adultery with Bathsheba and then had Uriah killed on the battlefield?

Now, if you consider the whole direction of David’s life, then you would be able to say that yes, David was devoted to the Lord and he sought to do God’s will. That’s true. For instance, when he had the chance to kill Saul, and his men were encouraging him to do it, he refused, because he knew it would be wrong in God’s sight for him to murder Saul, who was God’s king at that time. So, in general he was devoted to the Lord. But he can’t really say that he was blameless and that he had kept himself from sin, because David was a sinner like everyone else.

And, you see, there’s only ever been one person who could say these things about himself truthfully. And that’s the Lord Jesus Christ. He alone was blameless and he alone kept himself from sin always. And so, when David wrote this song of thanksgiving, though it partly applies to David, it also applies to the Lord Jesus Christ. And it fits his life perfectly.

The Lord Jesus

So, in the first half of the song, David wrote about God’s anointed king who was in deadly danger. The waves of death swirled around him. The torrents of destruction overwhelmed him. The cords of the grave coiled around him, pulling him down, down, down, closer to the grave. The snares of death confronted him. And, yes, this is about David who faced many enemies. But it’s also about the Lord Jesus. From the moment of his birth to the moment of his death on the cross, enemies confronted him and they conspired against him. And, when the time was right, he was arrested by the soldiers, and he was falsely accused by his enemies, and he was sentenced to death, and he was taken away and beaten and whipped and crucified and buried. And remember how David in verse 44 said that God rescued him from ‘my people’? Well, it was the Lord Jesus’s own people who conspired against him and who wanted to put him to death.

But the Lord God Almighty did not abandon him to his enemies or to the grave, because God the Father came down from his throne in heaven to raise his anointed king from the grave. He reached down from heaven and took hold of him and he drew him, not out of deep waters, but out of the depths of the grave. God rescued the Lord Jesus from death. And afterwards, he raised the Lord Jesus up above his enemies and up to heaven above to rule as king over all the nations. And through the preaching of the gospel, by preachers sent from God, men and women and boys and girls from every nation are now submitting to him all over the world and they’re yielding their lives to him and they’re obeying him as their king.

So, just as God rescued David from his enemies and made him king over many nations, so the Lord God Almighty rescued the Lord Jesus from his enemies and made him king over all the nations.

And why was the Lord God Almighty willing to rescue the Lord Jesus from his enemies and to make him king over all the nations? Let’s go back to verses 21 to 31 which begins with the words:

The Lord has dealt with me according to my righteousness….

The Lord Jesus is the only truly righteous person, because he’s the only person who always did everything right and who obeyed the will of God in all things, even to the point of death on the cross, because wasn’t it the will of God the Father for the Lord Jesus Christ to give up his life on the cross as the perfect sacrifice for our sin? Wasn’t that the will of God the Father for him? And the Lord Jesus perfectly obeyed the will of his Father and he did everything right. And because he did everything right and because his hands were clean and because he was blameless and had kept himself from sin, and was obedient even to the point of death on the cross, God the Father raised him from the grave and exalted him to the highest place, far above all his enemies to rule as king over all.


And here’s the thing. By believing in the Lord Jesus Christ, you are declared righteous in the sight of God. That is, you are declared right with God forever. So, even though you may have done everything wrong, God will treat you as if you’ve done everything right for the sake of Christ the Saviour, who gave up his life to pay for your sins and who shed his blood to cleanse you. Even though you may have done everything wrong, God treats you for Christ’s sake as though you have done everything right, as though your hands were clean, as though you have kept his ways perfectly, as though you have never done any evil, as though you have never turned away from his decrees, as though you were blameless, as though you had always kept yourself from sin. That’s how he will treat you if you’re trusting in Jesus Christ.

And that means that when you face troubles and trials in your life, and when you’re in distress, you can call on the Lord God Almighty. And for the sake of Christ the Saviour, he will hear you and he will reach down from heaven to help you. He’ll give you the help and strength you need to cope with all of this life’s troubles and trials and dangers. He will be your rock and your fortress and your deliverer; and your shield and the horn of your salvation; and your stronghold and your refuge and your saviour.

And even if the worst thing happens, even if the worst thing happens, and you die and your body is laid in the ground, you can be assured that one day God will reach down from on high and he will take hold of you and he will draw you from the grave so that you will live with him in body and soul forever and forever, because just as God rescued the Lord Jesus from the grave, so he will rescue from the grave all who have trusted in his Son.

And so, if you’re a believer, trusting in Christ the Saviour for peace with God, then you can rest assured that God will not abandon you to this life’s troubles and trials, but he will help you. And if you’re a believer, trusting in Christ the Saviour for peace with God, then you can rest assured that God will not abandon you to the grave, but he will raise you from it to live with him in the new and better world to come.