Galatians 3:21-29 (ESV)
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.  But the Scripture imprisoned everything under sin, so that the promise by faith in Jesus Christ might be given to those who believe.
 Now before faith came, we were held captive under the law, imprisoned until the coming faith would be revealed.  So then, the law was our guardian until Christ came, in order that we might be justified by faith.  But now that faith has come, we are no longer under a guardian,  for in Christ Jesus you are all sons of God, through faith.  For as many of you as were baptized into Christ have put on Christ.  There is neither Jew nor Greek, there is neither slave nor free, there is neither male nor female, for you are all one in Christ Jesus.  And if you are Christ's, then you are Abraham's offspring, heirs according to promise.
The law is not contrary to the promises of God. People want to make it out that way though. Every time you mention justification by faith alone, you get the question: “Well then what is the law for?” To imprison everything under sin! So that the promise might be given by faith in Christ. It isn’t the law that is contrary to the Gospel, it is the reliance on the law for salvation that is contrary to the Gospel, to the promises of God. The Law is good, it is holy, yada yada yada, it just can’t give life. Christ gives life in the forgiveness of sins. And this he does for all, Jew and Greek, slave or free, male or female, our sins are forgiven equally.