The anger of the Lord was kindled against Israel again, and he incited David against them, saying: go, number Israel and Judah. David orders Joab to count the people. Joab asks why he wants to do it, but the king insists. Joab and the commanders travel the land for nine months and twenty days and report the results: eight hundred thousand fighting men in Israel and five hundred thousand in Judah.
After he has counted the people, David's heart strikes him. He tells the Lord that he has sinned greatly and asks him to take away the guilt of his servant, for he has acted very foolishly. In the morning, the prophet Gad, David's seer, brings him the word of the Lord: choose among seven years of famine (three in some ancient manuscripts), three months of fleeing before his enemies or three days of pestilence in the land. David answers that he is in great distress, but he would rather fall into the hand of the Lord, for his mercy is great, and not into the hand of man.
The Lord sends a pestilence on Israel from the morning until the appointed time, and seventy thousand men die from Dan to Beersheba. When the angel stretches out his hand toward Jerusalem to destroy it, the Lord relents and tells him to stop at the threshing floor of Araunah the Jebusite. David, seeing the angel, tells the Lord that he is the one who has sinned, and asks what the sheep have done; he asks that the hand fall on him and his house. Gad tells him to go up and build an altar at the threshing floor of Araunah. Araunah offers to give him everything, but David answers that he will not offer to the Lord burnt offerings that cost him nothing. He buys the threshing floor and the oxen for fifty shekels of silver, builds an altar there, offers burnt offerings and peace offerings, and the Lord answers the plea for the land and the plague is stopped.