2 Samuel 24:1-17 ESV
Again the anger of the LORD was kindled against Israel, and he incited David against them, saying, “Go, number Israel and Judah.” So the king said to Joab, the commander of the army, who was with him, “Go through all the tribes of Israel, from Dan to Beersheba, and number the people, that I may know the number of the people.” But Joab said to the king, “May the LORD your God add to the people a hundred times as many as they are, while the eyes of my lord the king still see it, but why does my lord the king delight in this thing?” But the king’s word prevailed against Joab and the commanders of the army. So Joab and the commanders of the army went out from the presence of the king to number the people of Israel. They crossed the Jordan and began from Aroer, and from the city that is in the middle of the valley, toward Gad and on to Jazer. Then they came to Gilead, and to Kadesh in the land of the Hittites; and they came to Dan, and from Dan they went around to Sidon, and came to the fortress of Tyre and to all the cities of the Hivites and Canaanites; and they went out to the Negeb of Judah at Beersheba. So when they had gone through all the land, they came to Jerusalem at the end of nine months and twenty days. And Joab gave the sum of the numbering of the people to the king: in Israel there were 800,000 valiant men who drew the sword, and the men of Judah were 500,000.
But David’s heart struck him after he had numbered the people. And David said to the LORD, “I have sinned greatly in what I have done. But now, O LORD, please take away the iniquity of your servant, for I have done very foolishly.” And when David arose in the morning, the word of the LORD came to the prophet Gad, David’s seer, saying, “Go and say to David, ‘Thus says the LORD, Three things I offer you. Choose one of them, that I may do it to you.’” So Gad came to David and told him, and said to him, “Shall three years of famine come to you in your land? Or will you flee three months before your foes while they pursue you? Or shall there be three days’ pestilence in your land? Now consider, and decide what answer I shall return to him who sent me.” Then David said to Gad, “I am in great distress. Let us fall into the hand of the LORD, for his mercy is great; but let me not fall into the hand of man.”
So the LORD sent a pestilence on Israel from the morning until the appointed time. And there died of the people from Dan to Beersheba 70,000 men. And when the angel stretched out his hand toward Jerusalem to destroy it, the LORD relented from the calamity and said to the angel who was working destruction among the people, “It is enough; now stay your hand.” And the angel of the LORD was by the threshing floor of Araunah the Jebusite. Then David spoke to the LORD when he saw the angel who was striking the people, and said, “Behold, I have sinned, and I have done wickedly. But these sheep, what have they done? Please let your hand be against me and against my father’s house.”
ESV: English Standard Version 2016