1 Chronicles 21:8
And David said unto God, I have sinned greatly, because I have done this thing: but now, I beseech thee, do away the iniquity of thy servant; for I have done very foolishly. (1 Chronicles 21:8)
1-13 (2 Samuel 24:1-14). David Trusted Himself to God’s Mercies
 The work of numbering Israel is not fully completed before David feels convicted that he has committed a great sin against God. He sees his error, and humbles himself before God, confessing his great sin in foolishly numbering the people. But his repentance came too late. The word had already gone forth from the Lord to His faithful prophet, to carry a message to David, and offer him his choice of punishments for his transgression. David still shows that he has confidence in God. He chooses to fall into the hands of a merciful God, rather than to be left to the cruel mercies of wicked men (The Spirit of Prophecy 1:385).