Satan stood up against Israel and incited David to count [the people of] Israel.
So David said to Joab and the commanders of the troops, "Go and count Israel from Beer-sheba to Dan and bring [a report] to me so I can know their number."
Joab replied, "May the LORD multiply the number of His people a hundred times over! My lord the king, aren't they all my lord's servants? Why does my lord want to do this? Why should he bring guilt on Israel?"
Yet the king's order prevailed over Joab. So Joab left and traveled throughout Israel and then returned to Jerusalem.
Joab gave David the total of the registration of the troops. In all Israel there were 1,100,000 swordsmen and in Judah itself 470,000 swordsmen.
But he did not include Levi and Benjamin in the count because the king's command was detestable to him.
This command was also evil in God's sight, so He afflicted Israel.
David said to God, "I have sinned greatly because I have done this thing. Now, because I've been very foolish, please take away your servant's guilt."
Then the LORD instructed 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 for yourself, and I will do it to you.'"
So Gad went to David and said to him, "This is what the LORD says: 'Take your [choice]--
either three years of famine, three months of devastation by your foes with the sword of your enemy overtaking you, or three days of the sword of the LORD-- a plague on the land, the angel of the LORD bringing destruction to the whole territory of Israel.' Now decide what answer I should take back to the One who sent me."
David answered Gad, "I have great anxiety. Please, let me fall into the LORD's hands because His mercies are very great, but don't let me fall into human hands."
So the LORD sent a plague on Israel, and 70,000 Israelite men died.
Then God sent an angel to Jerusalem to destroy it, but when the angel was about to destroy the city, the LORD looked, 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 standing at the threshing floor of Ornan the Jebusite.
When David looked up and saw the angel of the LORD standing between earth and heaven, with his drawn sword in his hand stretched out over Jerusalem, David and the elders, clothed in sackcloth, fell down with their faces [to the ground].
David said to God, "Wasn't I the one who gave the order to count the people? I am the one who has sinned and acted very wickedly. But these sheep, what have they done? My LORD God, please let Your hand be against me and against my father's family, but don't let the plague be against Your people."
So the angel of the LORD ordered Gad to tell David to go and set up an altar to the LORD on the threshing floor of Ornan the Jebusite.
David went up at Gad's command spoken in the name of the LORD.
Ornan was threshing wheat when he turned and saw the angel. His four sons, who were with him, hid themselves.
David came to Ornan, and when Ornan looked and saw David, he left the threshing floor and bowed to David with his face to the ground.
Then David said to Ornan, "Give me this threshing-floor plot so that I may build an altar to the LORD on it. Give it to me for the full price, so the plague on the people may be halted."
Ornan said to David, "Take it! My lord the king may do whatever he wants. See, I give the oxen for the burnt offerings, the threshing sledges for the wood, and the wheat for the grain offering-- I give it all."
King David answered Ornan, "No, I insist on paying the full price, for I will not take for the LORD what belongs to you or offer burnt offerings that cost [me] nothing."
So David gave Ornan 15 pounds of gold for the plot.
He built an altar to the LORD there and offered burnt offerings and fellowship offerings. He called on the LORD, and He answered him with fire from heaven on the altar of burnt offering.
Then the LORD spoke to the angel, and he put his sword back into its sheath.
At that time, when David saw that the LORD answered him at the threshing floor of Ornan the Jebusite, he offered sacrifices there.
At that time the tabernacle of the LORD, which Moses made in the desert, and the altar of burnt offering were at the high place in Gibeon,
but David could not go before it to inquire of God, because he was terrified of the sword of the LORD's angel.