1 Chronicles 21

ISV(i) 1 David’s Unauthorized Census
Then Satan attacked Israel by inciting David to enumerate a census of Israel. 2 David ordered Joab and the commanders of the army, “Go take a census of Israel from Beer-sheba to Dan, and bring me a report so I can be aware of the total number.”
3 But Joab replied, “May the LORD increase the population of his people a hundredfold! Your majesty, all of them are your majesty’s servants, aren’t they? So why should your majesty demand this? Why should he bring guilt to Israel?”
4 But the king’s order overruled Joab, so Joab left, traveled throughout all of Israel, and then returned to Jerusalem 5 to report the total population count to David. Throughout all of Israel there were 1,100,000 men trained for war. In Judah there were 470,000 men trained for war. 6 Levi and Benjamin were not included in the census, because what the king had commanded was unethical to Joab.
7 David Chooses His Punishment
God considered this behavior to be evil, so he attacked Israel. 8 David responded to God, “I sinned greatly by behaving this way. But now I am asking you, please remove the guilt of your servant, since I have acted very foolishly.”
9 So the LORD responded through Gad, David’s seer. 10 “Go and tell David, ‘This is what the LORD says: “I’m holding three choices out for you: pick one of them for yourself, and I will do it to you.”’”
11 Gad went to David and told him, “This is what the LORD says: ‘Make a choice for yourself: 12 Either three years of famine, or three months of reversals as you are swept away by your enemies while the sword of your enemies overtakes you, or three days with the sword of the LORD, consisting of pestilence infecting the land, with the angel of the LORD wreaking destruction from border to border throughout all of Israel.’ Decide right now what I am to answer to the one who sent me.”
13 So David replied to Gad, “This is a very bad choice for me to make! Let me now please fall into the hand of the LORD, because his mercy is very great, but may I never fall into human hands!”
14 Then the LORD sent a pestilence to Israel, and 70,000 men died in Israel. 15 God also sent an angel to destroy Jerusalem, but as he was about to do so, the LORD looked and withdrew the calamity by saying to the destroying angel, “Enough! Stop what you’re doing!”
So the angel of the LORD remained standing near the threshing floor that belonged to Ornan the Jebusite. 16 David looked up and saw the angel of the LORD standing between earth and heaven, with a drawn sword in his hand stretched out over Jerusalem. Then David and the elders, clothed in sackcloth, fell on their faces.
17 David told God, “Wasn’t I the one who ordered the census of the population? Wasn’t it I who sinned and acted wickedly? Now as for these sheep, what have they done? LORD God, please let your hand be against me and my ancestral household, but don’t let your people be ravaged by plague!”
18 David’s Altar
The angel of the LORD told Gad to tell David that David was to go up and build an altar to the LORD on the threshing floor that belonged to Ornan the Jebusite. 19 So David went up, obeying Gad’s directive that he had spoken in the name of the LORD. 20 Ornan turned around and saw the angel. While his four sons with him ran away to hide, Ornan continued to thresh wheat. 21 As David approached Ornan, Ornan looked around and observed David, left the threshing floor, and fell to the ground before David with his face on the ground.
22 David told Ornan, “Give me the threshing floor as a site to build an altar to the LORD on it. Give it to me at its full price, so the plague may be averted from the people.”
23 But Ornan replied to David, “Take it! Let your majesty the king do whatever seems like a good idea to him. Look here! I’m giving the oxen for burnt offerings, the threshing machinery for the wood, and the wheat for a grain offering. I’m giving all of it.”
24 But King David told Ornan, “No. I will buy them for the full price because I will not offer to the LORD what is yours or offer burnt offerings that cost me nothing.”
25 So David paid Ornan 600 shekels weight worth in gold for the site, 26 built an altar to the LORD there, and presented burnt offerings and peace offerings. He called out to the LORD, and he answered him from heaven with fire on the altar of burnt offerings. 27 After this, the LORD spoke to the angel, who then sheathed his sword.
28 From that time on, after David had observed that the LORD had answered him at the threshing floor of Ornan the Jebusite, he made his sacrifices there. 29 Meanwhile, the tent of the LORD that Moses had crafted in the desert, along with the altar of burnt offerings, were being stored at the high place in Gibeon at that time, 30 but David was not going before it to inquire of God, because he was afraid of the sword carried by the angel of the LORD.