Psalm 7:9 NKJV

The Righteous God: Testing Hearts

There’s a kind of prayer you only pray when you’re tired of watching evil win. Psalm 7:9 is one of those prayers. David isn’t whispering here—he’s pleading with conviction, longing for God to step in and make things right.

“Oh, let the wickedness of the wicked come to an end…”  

This isn’t just about David’s enemies. It’s about all evil—every injustice, every corrupt plan, every destructive habit, every sin that ruins lives. Anyone who loves God eventually reaches this point: Lord, enough. End it.

And David isn’t asking for revenge. He’s asking for transformation. He’s asking for sin to lose its grip—on the world, on others, and even on himself. He wants the stream of sin that runs so strongly toward self and the world to be turned back toward God. When wickedness dies, righteousness can flourish.

“…but establish the just.”  

David doesn’t just want evil to stop; he wants good to stand firm. He wants God’s people to be strengthened, grounded, protected, and unshaken. He wants righteousness to take root and stay rooted.

This is the heartbeat of every believer who longs for God’s kingdom to come

Not only the fall of wickedness,

but the rise of righteousness.

“For the righteous God tests the hearts and minds.”  

The reason he can pray this way is simple: “the righteous God tests the hearts and minds.” God doesn’t look at the surface. He sees the hidden motives, the secret thoughts, the things we barely admit to ourselves. Because He knows every heart perfectly, He can judge fairly. He knows who is truly wicked and who is truly His. That knowledge is the ground of David’s confidence.

David anchors his prayer in God’s character. God sees everything—motives, desires, hidden thoughts, buried wounds, secret sins, quiet faithfulness. Nothing is concealed from Him.

And because God sees perfectly, He judges perfectly. He knows how to end wickedness without crushing the repentant. He knows how to establish the righteous without ignoring their weaknesses. He knows how to purify, correct, strengthen, and uphold.

This verse is both sobering and comforting. Sobering, because God examines the deepest parts of us. Comforting, because He does so with perfect justice and perfect love.

Prayer

Cross References (NKJV)

Jeremiah 17:10

“I, the Lord, search the heart, I test the mind, Even to give every man according to his ways, According to the fruit of his doings.”

1 Peter 5:10

“But may the God of all grace, who called us to His eternal glory by Christ Jesus, after you have suffered a while, perfect, establish, strengthen, and settle you.”

Psalm 26:2

“Examine me, O Lord, and prove me; Try my mind and my heart.”

Revelation 2:23

“…and all the churches shall know that I am He who searches the minds and hearts. And I will give to each one of you according to your works.”

Psalm 139:23-24

“Search me, O God, and know my heart; Try me, and know my anxieties; And see if there is any wicked way in me, And lead me in the way everlasting.”

Key Takeaways

  • It’s right to pray that wickedness itself would come to an end—not just the particular wrong done to you.
  • Asking God to “establish the just” is a prayer for perseverance, deeper faith, and courage to keep doing good.
  • God already sees every motive and hidden thought. That truth should both comfort the sincere and warn the pretender.
  • The same God who tests hearts is the One who can turn a heart around and keep a heart steady.
  • This prayer keeps us from bitterness. Instead of only wanting our enemies stopped, we start wanting righteousness to take root everywhere.

Proverb for Today

Daily Scripture

Closing

“The Lord bless you and keep you; The Lord make His face shine upon you, And be gracious to you; The Lord lift up His countenance upon you, And give you peace.”  Numbers 6:24-26 NKJV

Grace be with you. Amen.

Please enter your email and click subscribe to be notified whenever I submit a new post. 

Summary of Commentaries:

David’s cry in Psalm 7:9 reflects the longing of every believer who’s tired of watching evil thrive. Spurgeon highlights this shared desire for wickedness to end and righteousness to stand firm. Commentators agree: David isn’t asking for favoritism—he’s pleading for God’s justice to prevail. Barnes and Gill remind us that God sees every hidden motive and thought, and Matthew Henry adds that God alone can end sin, strengthen the righteous, and judge with perfect accuracy.

Commentaries:

Charles Spurgeon

He sees a smile of complacency upon the face of the King, and in the name of all the assembled congregation he cries aloud, “Oh let the wickedness of the wicked come to an end; but establish the just.” Is not this the universal longing of the whole company of the elect? When shall we be delivered from the filthy conversation of these men of Sodom? When shall we escape from the filthiness of Mesech and the blackness of the tents of Kedar?

What a solemn and weighty truth is contained in the last sentence of the ninth verse! How deep is the divine knowledge!—”He trieth.” How strict, how accurate, how intimate his search!—”he trieth the hearts,” the secret thoughts, “and reins,” the inward affections. “All things are naked and opened to the eyes of him with whom we have to do.”

______________________________________________________

Enduring Word

Let the wickedness of the wicked come to an end, but establish the just: This reveals more of the heart of David’s prayer. More than anything, he prayed for God to be just. David did not pray for special favoritism with God; he prayed for God to be just, and he searched his own heart to help put him right before God. (Guzik)

i. David seemed to pray here beyond his own personal needs. “There is a great breadth of vision here, revealing a concern for universal justice which was always the motive behind David’s personal appeals for vindication.” (Kidner)

______________________________________________________

Albert Barnes

Oh let the wickedness of the wicked come to and end — Of all the wicked; wickedness not in this particular case only, but wickedness of all forms, and in all lands. The prayer here is a natural one; when a man becomes impressed with a sense of the evil of sin in one form, he wishes that the world may be delivered from it in all forms and altogether.

But establish the just — The righteous. This stands in contrast with his desire in regard to the wicked. He prays that the righteous may be confirmed in their integrity, and that their plans may succeed. This prayer is as universal as the former, and is, in fact, a prayer that the world may come under the dominion of the principles of truth and holiness.

For the righteous God trieth the hearts and reins — That is, the hearts and reins of all people. He understands the character of all people; he is intimately acquainted with all their thoughts, and purposes, and feelings. To search or try “the heart and the reins” is an expression frequently used in the Bible to denote that God is intimately acquainted with all the thoughts and feelings of people; that is, that he thoroughly understands the character of all people. The word “heart” in the Scriptures is often used to denote the seat of the “thoughts;” and the word “reins” seems to be used to denote the most secret feelings, purposes, and devices of the soul – as if lodged deep in our nature, or covered in the most hidden and concealed portions of the man. The word “reins,” with us, denotes the kidneys. In the Scriptures the word seems to be used, in a general sense, to denote the inward parts, as the seat of the affections and passions.

The Hebrew word כליה kilyâh, means the same as the word “reins” with us – the kidneys, Exodus 29:13, Exodus 29:22; Job 16:13; Isaiah 34:6; Deuteronomy 32:14. From some cause, the Hebrews seem to have regarded the “reins” as the seat of the affections and passions, though perhaps only in the sense that they thus spoke of the “inward” parts, and meant to denote the deepest purposes of the soul – as if utterly concealed from the eye. These deep thoughts and feelings, so unknown to other people, are all known intimately to God, and thus the character of every man is clearly understood by him, and he can judge every man aright. The phrase used here – of trying the hearts and reins – is one that is often employed to describe the Omniscience of God. Compare Jeremiah 11:20; Jeremiah 17:10; Jeremiah 20:12; Psalms 26:2; Psalms 139:13; Revelation 2:23. The particular idea here is, that as God searches the hearts of all people, and understands the secret purposes of the soul, he is able to judge aright, and to determine correctly in regard to their character, or to administer his government on the principles of exact justice. Such is the ground of the prayer in this case, that God, who knew the character of all people, would confirm those who are truly righteous, and would bring the wickedness of the ungodly to an end.

______________________________________________________

John Gill

Oh, let the wickedness of the wicked come to an end,…. Which will not be till the measure of it is fully up, and that will not be till the wicked are no more; for, as long as they are in the world they will be committing wickedness, and like the troubled sea continually cast up the mire and dirt of sin; and they will remain to the end of the world, till the new Jerusalem church state shall take place, when all the Lord’s people will be righteous, and there will not be a Canaanite in the house of the Lord of hosts, nor a pricking brier or grieving thorn in all the land; for, in the new earth will no sinner be, but righteous persons only; and for this state the psalmist may be thought to pray; however by this petition and the following he expresses his hatred of sin and love of righteousness: some choose to render the words, “let wickedness now consume the wicked”; as in the issue it will, unless the grace of God takes place; some sins consume the bodies, others the estates of wicked men, and some both; and all are the means of destroying both body and soul in hell, if grace prevent not; this may be considered as a declaration of what will be, being a prophetic petition.

but establish the just; or righteous one; meaning himself, and every other who is made righteous, not by his own righteousness, but by the righteousness of Christ imputed to him; and who needs not to have his righteousness established, which is in itself stable, firm, and sure, and cannot be more so; it is an everlasting one, and cannot be abolished, but abides for ever, and will answer for him in a time to come; but his faith to be established more and more in its exercise on this righteousness: nor do the persons of the just need establishing, or can they be more stable than they are, as considered in Christ, as they are the objects of God’s everlasting love, secured in the covenant of grace, and built on Christ the foundation; but the graces of faith, hope, and love, need daily establishing on their proper object, they being weak, fickle, and inconstant in their acts; and the saints need more and more establishing in the doctrines of the Gospel, and in their adherence to the cause of God and Christ and true religion; and it is God’s work to establish them, to whom the psalmist applies; see 1 Peter 5:10;

for the righteous God trieth the hearts and reins; he is righteous himself in his nature, and in all his works, and he knows who are righteous and who are wicked; he knows the hearts, thoughts, affections, and inward principles of all men, and the springs of all their actions; he looks not at outward appearances, but at the heart; and as he can distinguish between the one and the other, he is capable of punishing the wicked and of confirming the righteous, consistent with the truth of his perfections.

______________________________________________________

Matthew Henry

He prays, in general, for the conversion of sinners and the establishment of saints (v. 9): “O let the wickedness, not only of my wicked enemies, but of all the wicked, come to an end! but establish the just.” Here are two things which everyone of us must desire and may hope for:-

(1.) The destruction of sin, that it may be brought to an end in ourselves and others. When corruption is mortified, when every wicked way and thought are forsaken, and the stream which ran violently towards the world and the flesh is driven back and runs towards God and heaven, then the wickedness of the wicked comes to an end. When there is a general reformation of manners, when atheists and profane are convinced and converted, when a stop is put to the spreading of the infection of sin, so that evil men proceed no further, their folly being made manifest, when the wicked designs of the church’s enemies are baffled, and their power is broken, and the man of sin is destroyed, then the wickedness of the wicked comes to an end. And this is that which all that love God, and for his sake hate evil, desire and pray for.

(2.) The perpetuity of righteousness: But establish the just. As we pray that the bad maybe made good, so we pray that the good may be made better, that they may not be seduced by the wiles of the wicked nor shocked by their malice, that they may be confirmed in their choice of the ways of God and in their resolution to persevere therein, may be firm to the interests of God and religion and zealous in their endeavors to bring the wickedness of the wicked to an end. His plea to enforce this petition is, For the righteous God trieth the hearts and the reins; and therefore he knows the secret wickedness of the wicked and knows how to bring it to an end, and the secret sincerity of the just he is witness to and has secret ways of establishing.

As far as we have the testimony of an unbiased conscience for us that in any instance we are wronged and injuriously reflected on, we may, in singing these verses, lodge our appeal with the righteous God, and be assured that he will own our righteous cause, and will one day, in the last day at furthest, bring forth our integrity as the light.




Follow me on X – @billstephens_59
Follow me on Truth – @billstephens1959 

Leave a Reply

Discover more from Collection of Commentaries

Subscribe now to keep reading and get access to the full archive.

Continue reading