Satan rose 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 the total troop registration to David. In all Israel there were one million one hundred thousand armed men and in Judah itself four hundred seventy thousand armed men. 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, please take away your servant’s guilt, for I’ve been very foolish.”
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: three years of famine, or 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’m in anguish. 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 seventy thousand 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, covered in sackcloth, fell facedown. 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? LORD my God, please let your hand be against me and against my father’s family, but don’t let the plague be against your people.”