Satan stood up against Israel, and incited David to count the people of Israel. 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.” 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?” But the king’s word prevailed against Joab. So Joab departed and went throughout all Israel, and came back to Jerusalem. 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. But he did not include Levi and Benjamin in the numbering, for the king’s command was abhorrent to Joab.
But God was displeased with this thing, and he struck Israel. David said to God, “I have sinned greatly in that I have done this thing. But now, I pray you, take away the guilt of your servant; for I have done very foolishly.” The Lord spoke to Gad, David’s seer, saying, “Go and say to David, ‘Thus says the Lord: Three things I offer you; choose one of them, so that I may do it to you.’” So Gad came to David and said to him, “Thus says the Lord, ‘Take your choice: either three years of famine; or three months of devastation by your foes, while the sword of your enemies overtakes you; or three days of the sword of the Lord, pestilence on the land, and the angel of the Lord destroying throughout all the territory of Israel.’ Now decide what answer I shall return to the one who sent me.” Then David said to Gad, “I am in great distress; let me fall into the hand of the Lord, for his mercy is very great; but let me not fall into human hands.”