1 Chronicles 21:1-7 New Revised Standard Version (NRSV)
The Census and Plague
21 Satan stood up against Israel, and incited David to count the people of Israel. 2 So David said to Joab and the commanders of the army, “Go, number Israel, from Beer-sheba to Dan, and bring me a report, so that I may know their number.” 3 But Joab said, “May the Lord increase the number of his people a hundredfold! 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 on Israel?” 4 But the king’s word prevailed against Joab. So Joab departed and went throughout all Israel, and came back to Jerusalem. 5 Joab gave the total count 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 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 Joab.
7 But God was displeased with this thing, and he struck Israel.