And they were both righteous before God,.... Not as the Pharisees, only righteous before men, but in the sight of God, who sees the heart, and whose judgment is according to truth; and therefore were not justified by the deeds of the law; for by them no man can be justified in the sight of God; but were made righteous through the righteousness of Christ, by which the saints were made righteous before the coming of Christ, as those after it: see Ac 15:11.
God beheld them in his Son, as clothed with that righteousness he engaged to bring in, and as cleansed from all sin in that blood of his which was to be shed: and they appeared to him, and in the eye of his justice, and according to his law, righteous persons: though this character may also regard the internal holiness of their hearts, and the truth and sincerity of grace in them: which God, who trieth the hearts and reins of the children of men, knew, took notice of, and bore testimony to: as likewise their holy, upright walk and conversation before men, and which was observed by God, and acceptable to him, though imperfect, as arising from a principle of grace, being performed in the faith and fear of him, and with a view to his glory, and for the sake, and through the righteousness of his Son.