Satan rose up against Israel and caused David to take a census of the Israelites.
David gave these orders to Joab and his commanders: "Take a census of all the people in the land -- from Beersheba in the south to Dan in the north -- and bring me the totals so I may know how many there are."
But Joab replied, "May the LORD increase the number of his people a hundred times over! But why, my lord, do you want to do this? Are they not all your servants? Why must you cause Israel to sin?"
But the king insisted that Joab take the census, so Joab traveled throughout Israel to count the people. Then he returned to Jerusalem
and reported the number of people to David. There were 1,100,000 men of military age in Israel, and 470,000 in Judah.
But Joab did not include the tribes of Levi and Benjamin in the census because he was so distressed at what the king had made him do.
God was very displeased with the census, and he punished Israel for it.
Then David said to God, "I have sinned greatly and shouldn't have taken the census. Please forgive me for doing this foolish thing."
Then the LORD spoke to Gad, David's seer. This was the message: