1 Chronicles 21:2-12

2 So David said to Jo'ab and the commanders of the army, "Go, number Israel, from Beer-sheba to Dan, and bring me a report, that I may know their number."
3 But Jo'ab said, "May the LORD add to his people a hundred times as many as they are! Are they not, my lord the king, all of them my lord's servants? Why then should my lord require this? Why should he bring guilt upon Israel?"
4 But the king's word prevailed against Jo'ab. So Jo'ab departed and went throughout all Israel, and came back to Jerusalem.
5 And Jo'ab gave the sum of the numbering of the people to David. In all Israel there were one million one hundred thousand men who drew the sword, and in Judah four hundred and seventy thousand who drew the sword.
6 But he did not include Levi and Benjamin in the numbering, for the king's command was abhorrent to Jo'ab.
7 But God was displeased with this thing, and he smote Israel.
8 And David said to God, "I have sinned greatly in that I have done this thing. But now, I pray thee, take away the iniquity of thy servant; for I have done very foolishly."
9 And the LORD spoke to Gad, David's seer, saying,
10 "Go and say to David, 'Thus says the LORD, Three things I offer you; choose one of them, that I may do it to you.'"
11 So Gad came to David and said to him, "Thus says the LORD, 'Take which you will:
12 either three years of famine; or three months of devastation by your foes, while the sword of your enemies overtakes you; or else three days of the sword of the LORD, pestilence upon the land, and the angel of the LORD destroying throughout all the territory of Israel.' Now decide what answer I shall return to him who sent me."
Revised Standard Version of the Bible, copyright 1952 [2nd edition, 1971] by the Division of Christian Education of the National Council of the Churches of Christ in the United States of America. Used by permission. All rights reserved.