First, we maintain, that of what description soever any man's works may be, he is regarded as righteous before God simply on the footing of gratuitous mercy; because God, without any respect to works, freely adopts him in Christ, by imputing the righteousness of Christ to him, as if it were his own. This we call the righteousness of faith: that is, when a man, made void and empty of all confidence in works, feels convinced that the only ground of his acceptance with God is a righteousness which is wanting to himself, and is borrowed from Christ.
The point on which the world always goes astray (for this error has prevailed in almost every age) is in imagining that man, however partially defective he may be, still in some degree merits the favor of God by works. But scripture declares, "Cursed is every one that continueth not in all things that are written in the book of the law to do them" [Gal. 3:10]. Under this curse must necessarily lie all who are judged by works none being exempted save those who entirely renounce all confidence in works, and put on Christ, that they may be justified in him, by the gratuitous acceptance of God.
The ground of our justification, therefore, is that God reconciles us to himself, from regard not to our works, but to Christ alone, and, by gratuitous adoption, makes us, instead of children of wrath, to be his own children. So long as God looks to our works, he perceives no reason why he ought to love us. Wherefore, it is necessary to bury our sins, and impute to us the obedience of Christ (because [his is] the only obedience which can stand his scrutiny), and adopt us as righteous through his merits.
John Calvin, The Necessity of Reforming the Church (1453), Part II ("The Remedies Employed for the Correction of the Evils")