The LORD's anger burned against Israel again, and it stirred up David against them to say: "Go, count [the people of] Israel and Judah."
So the king said to Joab, the commander of his army, "Go through all the tribes of Israel from Dan to Beer-sheba and register the troops so I can know their number."
Joab replied to the king, "May the LORD your God multiply the troops 100 times more than they are-- while my lord the king looks on! But why does my lord the king want to do this?"
Yet the king's order prevailed over Joab and the commanders of the army. So Joab and the commanders of the army left the king's presence to register the troops of Israel.
They crossed the Jordan and camped in Aroer, south of the town in the middle of the valley, and then [proceeded] toward Gad and Jazer.
They went to Gilead and to the land of the Hittites and continued on to Dan-jaan and around to Sidon.
They went to the fortress of Tyre and all the cities of the Hivites and Canaanites. Afterwards, they went to the Negev of Judah at Beer-sheba.
When they had gone through the whole land, they returned to Jerusalem at the end of nine months and 20 days.
Joab gave the king the total of the registration of the troops. There were 800,000 fighting men from Israel and 500,000 men from Judah.
David's conscience troubled him after he had taken a census of the troops. He said to the LORD, "I have sinned greatly in what I've done. Now, Lord, because I've been very foolish, please take away your servant's guilt."
When David got up in the morning, a revelation from the LORD had come to the prophet Gad, David's seer:
"Go and say to David, 'This is what the LORD says: I am offering you three [choices]. Choose one of them, and I will do it to you.'"
So Gad went to David, told him [the choices], and asked him, "Do you want three years of famine to come on your land, to flee from your foes three months while they pursue you, or to have a plague in your land three days? Now, think it over and decide what answer I should take back to the One who sent me."
David answered Gad, "I have great anxiety. Please, let us fall into the LORD's hands because His mercies are great, but don't let me fall into human hands."
So the LORD sent a plague on Israel from that morning until the appointed time, and from Dan to Beer-sheba 70,000 men died.
Then the angel extended his hand toward Jerusalem to destroy it, but the LORD relented concerning the destruction and said to the angel who was destroying the people, "Enough, withdraw your hand now!" The angel of the LORD was then at the threshing floor of Araunah the Jebusite.
When David saw the angel striking the people, he said to the LORD, "Look, I am the one who has sinned; I am the one who has done wrong. But these sheep, what have they done? Please, let Your hand be against me and my father's family."
Gad came to David that day and said to him, "Go up and set up an altar to the LORD on the threshing floor of Araunah the Jebusite."
David went up in obedience to Gad's command, just as the LORD had commanded.
Araunah looked down and saw the king and his servants coming toward him, so he went out and bowed to the king with his face to the ground.
Araunah said, "Why has my lord the king come to his servant?" David replied, "To buy the threshing floor from you in order to build an altar to the LORD, so the plague on the people may be halted."
Araunah said to David, "My lord the king may take whatever he wants and offer it. Here are the oxen for a burnt offering and the threshing sledges and ox yokes for the wood.
[My] king, Araunah gives everything here to the king." Then he said to the king, "May the LORD your God accept you."
The king answered Araunah, "No, I insist on buying it from you for a price, for I will not offer to the LORD my God burnt offerings that cost [me] nothing." David bought the threshing floor and the oxen for 50 ounces of silver.
He built an altar to the LORD there and offered burnt offerings and fellowship offerings. Then the LORD answered prayer on behalf of the land, and the plague on Israel ended.