2 Samuel 24:9

And Joab gave up the sum of the number of the people unto the king: and there were in Israel eight hundred thousand valiant men that drew the sword; and the men of Judah were five hundred thousand men.

The sum given to the king was Joab's report from the numbering of Israel, and the work was left unfinished because conviction of great sin fell upon David before it could be fully completed. The numbering came after Israel had prospered and increased in numbers, wealth, and greatness under his rule, when the people forgot the Giver of all mercies and lost their peculiar holy and distinctive character, and David himself lost the humility and trust in God that had marked his earlier life. Yielding to the temptation of the devil, he acted in pride and ambition to set his former weakness and fewness when he ascended the throne against the present prosperity under his rule, taking the glory to himself.

The act was displeasing to God and contrary to His express command and order, for it would lead Israel to rely on strength of numbers instead of the living God. Numbering the people was not working according to God's order. Seeing his error, David humbled himself and confessed his foolishness in numbering the people, but his repentance came too late to stop punishment, for the word had already gone forth to the prophet to offer him his choice of punishments.

Even then he showed confidence in God by choosing to fall into the hands of a merciful God rather than be left to the cruel mercies of wicked men. Swift destruction followed, and seventy thousand were destroyed by pestilence, while David and the elders mourned in deepest humiliation. As the angel with drawn sword stretched out over Jerusalem went to destroy it, God, still loving His people notwithstanding their rebellion, bade him stay his work of death. Terrified at the sight of the angel, David in compassion for Israel confessed his own sin and wickedness and begged that God's hand be against him and his father's house and not upon the people. God bade him make atonement, his heart was in the work, and his wholehearted repentance was accepted.

The threshing floor of Araunah, with cattle and all needful for sacrifice, was offered to him freely, but he refused to come before the Lord with an offering that cost him nothing and bought it for full price. There he offered burnt offerings and peace offerings, and God accepted them by answering with fire from heaven to consume the sacrifice, and commanded the angel to put his sword into its sheath and cease the destruction. The account stands as an example of selfish human efforts to count and claim others, in contrast to God's gift of eternal life, which is free and open to all who receive Christ.