Before David arose the next morning, this message from the LORD came to Gad, David's seer: "Go 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."'" read more.
So Gad went to David and asked him, "Shall seven years of famine come to your land, or three months of reversals while you flee from your enemies as they pursue you, or three days of pestilence in your land? Decide right now what I am to answer to the one who sent me." So David replied to Gad, "This is a very difficult choice for me to make! Let me now please fall into the hand of the LORD, since his mercy is very great, but may I never fall into human hands!" That very morning, the LORD sent a pestilence to Israel until the conclusion of the time designated, and 70,000 men died from Dan to Beer-sheba. As the angel was stretching out his hand to destroy Jerusalem, the LORD was grieved because of the calamity, so he told the angel who was afflicting the people, "Enough! Stay your hand!" So the angel of the LORD remained near the threshing floor that belonged to Araunah the Jebusite. When David saw the angel who had been attacking the people, he told the LORD, "Look, I'm the one who has sinned! I did the evil. These are only sheep! What did they do? Please, let your hand fall on me and on my household!" That very day, Gad approached David and told him, "Go up and build an altar to the LORD on the threshing floor that belongs to Araunah the Jebusite." So David went up, just as Gad had ordered, consistent with the LORD's command.