On another occasion the Lord was angry with Israel, and he made David bring trouble on them. The Lord said to him, "Go and count the people of Israel and Judah."
So David gave orders to Joab, the commander of his army: "Go with your officers through all the tribes of Israel from one end of the country to the other, and count the people. I want to know how many there are."
But Joab answered the king, "Your Majesty, may the Lord your God make the people of Israel a hundred times more numerous than they are now, and may you live to see him do it. But why does Your Majesty want to do this?"
But the king made Joab and his officers obey his order; they left his presence and went out to count the people of Israel.
They crossed the Jordan and camped south of Aroer, the city in the middle of the valley, in the territory of Gad. From there they went north to Jazer,
References for 2 Samuel 24:5
and on to Gilead and to Kadesh, in Hittite territory. Then they went to Dan, and from Dan they went west to Sidon.
References for 2 Samuel 24:6
Then they went south to the fortified city of Tyre, on to all the cities of the Hivites and the Canaanites, and finally to Beersheba, in the southern part of Judah.
So after nine months and twenty days they returned to Jerusalem, having traveled through the whole country.
They reported to the king the total number of men capable of military service: 800,000 in Israel and 500,000 in Judah.
But after David had taken the census, his conscience began to hurt, and he said to the Lord, "I have committed a terrible sin in doing this! Please forgive me. I have acted foolishly."
The Lord said to Gad, David's prophet, "Go and tell David that I am giving him three choices. I will do whichever he chooses." The next morning, after David had gotten up,
Gad went to him, told him what the Lord had said, and asked, "Which is it to be? Three years of famine in your land or three months of running away from your enemies or three days of an epidemic in your land? Now think it over, and tell me what answer to take back to the Lord."
References for 2 Samuel 24:13
David answered, "I am in a desperate situation! But I don't want to be punished by people. Let the Lord himself be the one to punish us, for he is merciful."
So the Lord sent an epidemic on Israel, which lasted from that morning until the time that he had chosen. From one end of the country to the other seventy thousand Israelites died.
When the Lord's angel was about to destroy Jerusalem, the Lord changed his mind about punishing the people and said to the angel who was killing them, "Stop! That's enough!" The angel was by the threshing place of Araunah, a Jebusite.
David saw the angel who was killing the people, and said to the Lord, "I am the guilty one. I am the one who did wrong. What have these poor people done? You should punish me and my family."
That same day Gad went to David and said to him, "Go up to Araunah's threshing place and build an altar to the Lord."
David obeyed the Lord's command and went as Gad had told him to.
Araunah looked down and saw the king and his officials coming up to him. He threw himself on the ground in front of David
and asked, "Your Majesty, why are you here?" David answered, "To buy your threshing place and build an altar for the Lord, in order to stop the epidemic."
"Take it, Your Majesty," Araunah said, "and offer to the Lord whatever you wish. Here are these oxen to burn as an offering on the altar; here are their yokes and the threshing boards to use as fuel."
Araunah gave it all to the king and said to him, "May the Lord your God accept your offering."
References for 2 Samuel 24:23
But the king answered, "No, I will pay you for it. I will not offer to the Lord my God sacrifices that have cost me nothing." And he bought the threshing place and the oxen for fifty pieces of silver.
Then he built an altar to the Lord and offered burnt offerings and fellowship offerings. The Lord answered his prayer, and the epidemic in Israel was stopped.