Satan wanted to bring trouble on the people of Israel, so he made David decide to take a census.
David gave orders to Joab and the other officers, "Go through Israel, from one end of the country to the other, and count the people. I want to know how many there are."
Joab answered, "May the Lord make the people of Israel a hundred times more numerous than they are now! Your Majesty, they are all your servants. Why do you want to do this and make the whole nation guilty?"
But the king made Joab obey the order. Joab went out, traveled through the whole country of Israel, and then returned to Jerusalem.
He reported to King David the total number of men capable of military service: 1,100,000 in Israel and 470,000 in Judah.