2 Samuel 24:10-16 ESV
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.
ESV: English Standard Version 2016