2 Samuel 22:22

For I have kept the ways of the LORD and have not wickedly departed from my God.
2 Samuel 22:22 · ESVView all translations

David's song looks back over a lifetime of rescue, and verse 22 gives the reason for it. But how can the man whose worst sin the same book records claim that he never turned away from God?

A claim larger than the man singing

Psalm 51 is David's own confession of sin. One writer sets it beside this song:

From verses 21-25, we have the ground of the Lord's intervention on behalf of His servant. These verses prove that in this whole song we have a greater than David. David could not say, "The Lord rewarded me according to my righteousness... For I have kept the ways of the Lord, and have not wickedly departed from my God." How different this is from the language of Psalm 51... There it is, "Have mercy on me, O God, according to Your steadfast love; according to Your abundant mercy." That was suitable language for a fallen sinner, as David felt himself to be.

C. H. Mackintosh

Why the song reaches past David

The song says who was speaking through David:

He spoke these words through the Spirit of the Lord. "The Spirit of the LORD spoke by me and His word was in my tongue" (23:2). It is therefore a great prophetic utterance. The song takes us beyond David and his experience. The song shows his sufferings and rescues, but they only point to Another. David's life and experience foreshadow His sufferings and His victory... Verses 21-28 equally can only be true of our Lord. "For I have kept the ways of the Lord, and have not wickedly departed from my God." It is impossible to say that David spoke of himself.

Arno Clemens Gaebelein

The words weighed one by one

The words leave no room for exceptions. One writer traces what such keeping involved:

God has recompensed Him because He has kept the ways of the Lord. He has not wickedly departed from His God in the least way. All God's judgments were before Him as His constant meditation. This blessed Man of God ignored not one of His statutes... Certainly, perverseness was all around Him, but He was not influenced by this evil enemy. He stood out as the only One who would stand for simple truth in every detail of His way.

L. M. Grant

The phrase "I kept myself from my iniquity" (v. 24) is read as carrying real weight rather than being a figure of speech:

The expression "I kept myself from my iniquity" implies that if He had given in to it, this would have been iniquity on His part, but He kept Himself fully from it. Therefore the Lord recompensed Him because of His perfect righteousness and cleanness in the eyes of God.

Leslie M. Grant

Righteousness as the ground of being heard

Verse 22 answers a question: on what ground was the sufferer heard and rescued?

These verses give the ground on which God hears Christ in the day of His distress and delivers Him from all His enemies. It is in answer to His perfect obedience to the law. So there passes before us the path of perfect obedience that He walked on earth. The answer will appear in His exaltation and triumph in His thousand-year reign. Christ alone answered in an absolute way to the righteous requirements of God. He alone could say without reserve, "I have kept the ways of the Lord."

Hamilton Smith

Where the guilty come in

No reader can say verse 22 of himself. One writer shows where the comfort lies:

Here we see the wonderful grace that shines in redemption. The righteous One took the place of the guilty. "For our sake He made Him to be sin who knew no sin, so that in Him we might become the righteousness of God." Here is the sinner's resting-place... here he may see the Lord acting for his glorious and gracious representative, and so acting for him too — and all on strictly righteous grounds.

C. H. Mackintosh

David's side of the song

Even so, the man singing is not silenced by his past. One writer notes what the song leaves out:

The song remembers only the wrongs of an evil enemy who had never been wronged himself. All the story of sin and shame that followed is forgotten. David sings like a "virgin soul." The Spirit brings back nothing that could have stopped the song, or the joy pouring from his heart. When the Lord forgives, He forgets too.

J. G. Bellett

Commentators differ on how much of this David could own. One writer points to the end of David's own road:

Grace rested on him at that time because of the integrity and perfection of his conduct. He was at the end of his path of difficulties, and this path was the path of a walk with God. With a peaceful, rejoicing heart he celebrated the deliverance that grace granted to his faithfulness.

H. L. Rossier

Summary

- Ground. The "for" of verse 22 gives the reason for the rescue: kept ways, no wicked departure.

- Greater. That ground is too high for David. The same book shows him begging for mercy in Psalm 51. A greater than David is speaking.

- Spirit. The song is prophetic, spoken by the Spirit of the Lord, which is why its words run past the singer's own history.

- Gift. The righteous One took the place of the guilty. On righteous grounds, His righteousness becomes the sinner's resting place.

- Song. Forgiven, David still sings with joy. When the Lord forgives, He also forgets.

Reviewed by Orion on August 19, 2026