The Uses of the Divine Law
by Philip Melanchthon (from the 1535 Loci Communes), translated by Scott L. Keith, Ph.D.
Before we begin it is imperative to remind the reader that the Law of God requires the perfect obedience of the human nature. Further, because the human nature cannot perform this perfect obedience, it follows that men are not pronounced righteous before God on account of the Law—our nature always clings to sin. Therefore, the Apostle Paul speaks against justification by the law in our corrupted nature  . We briefly point this out before delving into the uses of the Divine Law so as not to infer that the Law justifies us. In fact, afterward, these passages will be treated in their entirety.
The Offices [or Functions] of the Law
What are the functions of the Law in this corrupted nature? They are three in number.
The First Office of the Law
The first is the civil office, namely, that all men are restrained and contained by a certain discipline. Of this office, Paul speaks in 1 Timothy 1:9: “understanding this, that the law is not laid down for the just but for the lawless and disobedient, for the ungodly and sinners, for the unholy and profane, for those who strike their fathers and mothers, for murderers.”
To establish and accomplish this discipline, God has ordained: (1) magistrates; (2) the law; (3) common instruction; (4) punishments; and (5) human suffering.  Also pertinent are sayings of Paul from Galatians 3:24: “So then, the law was our guardian  until Christ came, in order that we might be justified by faith.”
Thus this discipline, which Paul calls the pedagogy in Christ, is to be praised—certainly because this institution serves to habituate us to what is good, but also because this discipline imposes a certain orderliness on society which in turn enables us to hear and discern the Gospel. This wonderful praise [of the civil office of the Law] ought to stimulate the intellect of the moderate, so that this discipline is not refused. Yet, as I have said above, do not succumb to the opinion that such discipline can merit the forgiveness of sins.
The Second Office of the Law
The second office—the chief office—of the Divine Law is this: it shows us our sin, and accuses us, petrifies us, and condemns the conscience. The Apostle Paul speaks frequently of this function, such as when he says in Romans 3:20: “since through the law comes knowledge of sin.” Or when he says in Romans 4:15: “For the law brings wrath, but where there is no law there is no transgression.” And in 1 Corinthians 15:56: “The sting of death is sin, and the power of sin is the law.” This understanding similarly teaches that the Law terrifies the conscience, because it always accuses us. And not only does it make accusations against us, it exposes our natural weakness and condemns us of our ignorance towards God, our contempt of God, and our similar mistaken affections.
Thus, it almost goes without saying that those who fervently attempt to appease the wrath of God apart from the knowledge of His gracious mercy make no progress, but instead are more and more driven to doubt and despair. We can see this in the example of Saul, who, though he sought to be saved by the sacrifices of good works apart from faith, nevertheless could not rest, but remained in doubt and despair.
On the other hand, we do not have the law apart from this function, that is, that it is the final mortal blow to men, as Paul says in Romans 7:9.  Thus, “I was once alive apart from the law,” that is, I was a hypocrite and unworried. But afterwards I perceived my weakness and my sin, and I was terrified. This was how the Law was used on King David in 2 Samuel 12:13, when he was reproved by the prophet Nathan on account of his adultery, and was petrified. 
In short, “contrition,” which is called in such cases “repentance,” can be clearly understood if we know that these kinds of terrors are real. In other words, these terrors—that are the end of all men—strike out against us not only so we see that we will perish, but also so we know we need the kindness and mercy of Christ toward us. As Paul says in Romans 11:32: “For God has consigned all to disobedience, that He may have mercy on all.”
This knowledge, then, is a great consolation: when we conclude that we are under sin, the Law accuses us, not so that we perish, but so that we seek the mercy of God. And to be clear that such a great consolation belongs to us personally, the universal saying is added, so all may conclude that His mercy is indeed for all.
The Third Office of the Law
The third office of the Law in those who are justified by faith is that which teaches them about good works, about what works are pleasing to God, and about certain commandments in which obedience to God is exercised. For though we are free from the Law as far as justification is concerned, the Law remains with regard to obedience. But now that we are justified, we are bound to obey God; and indeed, we will begin to do at least some part of the Law. And it pleases Him that this obedience is begun in us, since we are pleasing to God on account of Christ.
What is given here appears to be sufficient regarding the uses, or offices, of the Law. Now, regarding justification: it must be said again that it belongs to the second use of the Law. And again I say the third use belongs in the topic of our works; of the abrogation of the Law.