For the king said to Joab the captain of the host who was with him, Go now through all the tribes of Israel, from Dan even to Beersheba, and count the people, that I may know their number.
And Joab said to the king, May the Lord your God add a hundred times as many people as there are, and let the eyes of my lord the king see it; but why does my lord the king delight in this thing?
They passed over the Jordan and encamped in Aroer, on the south side of the city lying in the midst of the ravine [of the Arnon] toward Gad, and on to Jazer.
And came to the stronghold of Tyre and to all the cities of the Hivites and Canaanites; and they went out to the South (the Negeb) of Judah at Beersheba.
And Joab gave the sum of the numbering of the people to the king. There were in Israel 800,000 valiant men who drew the sword, and the men of Judah were 500,000.
But David's heart smote him after he had numbered the people. David said to the Lord, I have sinned greatly in what I have done. I beseech You, O Lord, take away the iniquity of Your servant, for I have done very foolishly.
So Gad came to David and told him and said, Shall seven years of famine come to your land? Or will you flee three months before your pursuing enemies? Or do you prefer three days of pestilence in your land? Consider and see what answer I shall return to Him Who sent me.
And David said to Gad, I am in great distress. Let us fall into the hands of the Lord, for His mercies are many and great; but let me not fall into the hands of man.
So the Lord sent a pestilence upon Israel from the morning even to the time appointed; and there died of the people from Dan even to Beersheba 70,000 men.
And when the angel stretched out his hand upon Jerusalem to destroy it, the Lord relented of the evil and reversed His judgment and said to the destroying angel, It is enough; now stay your hand. And the angel of the Lord was by the threshing floor of Araunah the Jebusite.
When David saw the angel who was smiting the people, he spoke to the Lord and said, Behold, I have sinned and I have done wickedly; but these sheep, what have they done? Let Your hand, I pray You, be [only] against me and against my father's house.
Araunah said, Why has my lord the king come to his servant? And David said, To buy the threshing floor from you, to build there an altar to the Lord, that the plague may be stayed from the people.
And Araunah said to David, Let my lord the king take and offer up what seems good to him. Behold, here are oxen for burnt sacrifice, and threshing instruments and the yokes of the oxen for wood.
But King David said to Araunah, No, but I will buy it of you for a price. I will not offer burnt offerings to the Lord my God of that which costs me nothing. So David bought the threshing floor and the oxen for fifty shekels of silver.
David built there an altar to the Lord and offered burnt offerings and peace offerings. So the Lord heeded the prayers for the land, and Israel's plague was stayed.