Now David’s heart troubled him after he had numbered the people. So 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 acted very foolishly.” When David arose in the morning, the word of the LORD came to the prophet Gad, David’s seer, saying, “Go and speak to David, ‘Thus the LORD says, “I am offering you three things; choose for yourself one of them, which I will do to you.” ’ ” So Gad came to David and told him, and said to him, “Shall seven 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 see what answer I shall return to Him who sent me.” Then David said to Gad, “I am in great distress. Let us now fall into the hand of the LORD for His mercies are great, but do not let me fall into the hand of man.”
So the LORD sent a pestilence upon Israel from the morning until the appointed time, and seventy thousand men of the people from Dan to Beersheba died. When the angel stretched out his hand toward Jerusalem to destroy it, the LORD relented from the calamity and said to the angel who destroyed the people, “It is enough! Now relax 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 down the people, and said, “Behold, it is I who have sinned, and it is I who have done wrong; but these sheep, what have they done? Please let Your hand be against me and against my father’s house.”
So Gad came to David that day and said to him, “Go up, erect an altar to the LORD on the threshing floor of Araunah the Jebusite.” David went up according to the word of Gad, just as the LORD had commanded. Araunah looked down and saw the king and his servants crossing over toward him; and Araunah went out and bowed his face to the ground before the king. Then Araunah said, “Why has my lord the king come to his servant?” And David said, “To buy the threshing floor from you, in order to build an altar to the LORD, that the plague may be held back from the people.” Araunah said to David, “Let my lord the king take and offer up what is good in his sight. Look, the oxen for the burnt offering, the threshing sledges and the yokes of the oxen for the wood. Everything, O king, Araunah gives to the king.” And Araunah said to the king, “May the LORD your God accept you.” However, the king said to Araunah, “No, but I will surely buy it from you for a price, for I will not offer burnt offerings to the LORD my God which cost me nothing.” So David bought the threshing floor and the oxen for fifty shekels of silver. David built there an altar to the LORD and offered burnt offerings and peace offerings. Thus the LORD was moved by prayer for the land, and the plague was held back from Israel.