Think of the kings of Israel and contemplate their deeds: whoever among them feared Torah was delivered from troubles; and these were the seekers of Torah whose transgressions were forgiven. Think of David who was a man of righteous deeds and who was therefore delivered from many troubles and forgiven.--4Q398 lines 24-25, a letter written within the Jewish community at Qumran, and part of the Dead Sea Scrolls
For what does the Scripture say? "Abraham believed God, and it was counted to him as righteousness." Now to the one who works, his wages are not counted as a gift but as his due. And to the one who does not work but trusts him who justifies the ungodly, his faith is counted as righteousness, just as David also speaks of the blessing of the one to whom God counts righteousness apart from works: "Blessed are those whose lawless deeds are forgiven, and whose sins are covered; blessed is the man against whom the Lord will not count his sin."--The Apostle Paul, Romans 4:3-8
Intriguingly, in line 31 of this same fragment the writer of this Qumranite letter reflects on his readers' devotion to Torah (the Jewish Law) and writes that "it will be counted to you for righteousness." He uses the very same three-word string that is found in the Hebrew of Gen 15:6, speaking of Abraham's being counted righteous apart from his deeds, which Paul quotes in Romans 4:3 above.