The imprecatory Psalms have provided a lasting challenge for biblical interpreters, and many have struggled to understand how and when believers can pray for God’s judgement to come down upon their enemies. In considering this conundrum, Philipp Melanchthon (1497-1560) seeks to discern a rubric for this practice, and in commenting on Psalm 59:1-5 sets out four conditions that should be met when one believes it is necessary to invoke righteous judgment upon evildoers.

Psalm 59:1-5

Deliver me from my enemies, O God;
    be my fortress against those who are attacking me.
Deliver me from evildoers
    and save me from those who are after my blood.

See how they lie in wait for me!
    Fierce men conspire against me
    for no offense or sin of mine, Lord.
I have done no wrong, yet they are ready to attack me.
    Arise to help me; look on my plight!
You, Lord God Almighty,
    you who are the God of Israel,
rouse yourself to punish all the nations;
    show no mercy to wicked traitors.

Commentary on Psalm 59:1-5

The question here is . . . whether it is permitted to curse enemies, as is often done in the Psalms? I respond, if all four of these things are true. First, the cause which blasphemers protect must be condemned as severely as possible. Second, those propagators of blasphemies must be condemned because they sin “the sin unto death,” that is, they tenaciously persevere in sin. Third, because without the help of God truth cannot conquer, it is necessary to seek it from God that he represses errors and the propagators of these errors. This is prayed for when one curses the impious, and yet it is an intensely pious and necessary prayer. Fourth, such curses in the prophets should be read not only as human indignation but rather as the voice of the Holy Spirit, speaking the ultimate way of thinking about blasphemies and consoling the church so that it may know the truth that it will conquer, and God will repress and root out impious dogmas and the blasphemies of their propagators. Because this consolation is necessary for the church, it is often represented as curses, which have certainly been written more for consoling and strengthening the pious than for healing the impious who do not read them.

Psalms 1-72, ed. Herman J. Selderhuis, Reformation Commentary on Scripture, OT vol. 7, p. 480.