Galatians 3:19-22 (ESV)
19 Why then the law? It was added because of transgressions, until the offspring should come to whom the promise had been made, and it was put in place through angels by an intermediary. 20 Now an intermediary implies more than one, but God is one.
21 Is the law then contrary to the promises of God? Certainly not! For if a law had been given that could give life, then righteousness would indeed be by the law. 22 But the Scripture imprisoned everything under sin, so that the promise by faith in Jesus Christ might be given to those who believe.