Then the angel of the LORD commanded Gad to say to David, that David should go up, and set up an altar unto the LORD in the threshingfloor of Ornan the Jebusite. And David went up at the saying of Gad, which he spake in the name of the LORD. And Ornan turned back, and saw the angel; and his four sons with him hid themselves. Now Ornan was threshing wheat. And as David came to Ornan, Ornan looked and saw David, and went out of the threshingfloor, and bowed himself to David with his face to the ground.
Then David said to Ornan, “Grant me the place of this threshingfloor, that I may build an altar therein unto the LORD: thou shalt grant it me for the full price: that the plague may be stayed from the people.” And Ornan said unto David, “Take it to thee, and let my lord the king do that which is good in his eyes: lo, I give thee the oxen also for burnt offerings, and the threshing instruments for wood, and the wheat for the meat offering; I give it all.” And king David said to Ornan, “Nay; but I will verily buy it for the full price: for I will not take that which is thine for the LORD, nor offer burnt offerings without cost.”
So David gave to Ornan for the place six hundred shekels of gold by weight. And David built there an altar unto the LORD, and offered burnt offerings and peace offerings, and called upon the LORD; and He answered him from heaven by fire upon the altar of burnt offering. And the LORD commanded the angel; and he put up his sword again into the sheath thereof.
At that time when David saw that the LORD had answered him in the threshingfloor of Ornan the Jebusite, then he sacrificed there. For the tabernacle of the LORD, which Moses made in the wilderness, and the altar of the burnt offering, were at that season in the high place at Gibeon. But David could not go before it to enquire of God: for he was afraid because of the sword of the angel of the LORD. 1 Chronicles 21:18-30
References: 1 Chronicles 21:1-17; Genesis 22; 2 Samuel 24; Malachi 1:12-14; John 2:5; Acts 9:6; Romans 12:17; Hebrews 12:28-29