2 Samuel 24:18

And Gad came that day to David, and said unto him, Go up, rear an altar unto the LORD in the threshingfloor of Araunah the Jebusite.

God directed Gad to tell David that same day to go up and raise an altar to the Lord on the threshing floor of Araunah the Jebusite, to make atonement for his sin in numbering Israel. David obeyed with his whole heart in the work, and his repentance was accepted. Though Araunah freely offered him the threshing floor together with cattle and everything needful for sacrifice, David insisted on buying it for the full price. He would not come before the Lord with an offering that cost him nothing, while the Lord would accept the sacrifice he was willing to make.

There he offered burnt offerings and peace offerings, and God accepted the offering by sending fire from heaven to consume the sacrifice. God then commanded the angel to put his sword back into its sheath and to cease destroying Jerusalem.