1 Chronicles 21-22
And Satan stood up against Israel,
and provoked David to number Israel.
And David said to Joab and to the rulers of the people,
Go, number Israel from Beersheba even to Dan;
and bring the number of them to me, that I may know it.
22 Then David said, This is the house of the Lord God, and this is the altar of the burnt offering for Israel.
2 And David commanded to gather together the strangers that were in the land of Israel; and he set masons to hew wrought stones to build the house of God.
3 And David prepared iron in abundance for the nails for the doors of the gates, and for the joinings; and brass in abundance without weight;
4 Also cedar trees in abundance: for the Zidonians and they of Tyre brought much cedar wood to David.
5 And David said, Solomon my son is young and tender, and the house that is to be builded for the Lord must be exceeding magnifical, of fame and of glory throughout all countries: I will therefore now make preparation for it. So David prepared abundantly before his death.
6 Then he called for Solomon his son, and charged him to build an house for the Lord God of Israel.
7 And David said to Solomon, My son, as for me, it was in my mind to build an house unto the name of the Lord my God:
8 But the word of the Lord came to me, saying, Thou hast shed blood abundantly, and hast made great wars: thou shalt not build an house unto my name, because thou hast shed much blood upon the earth in my sight.
9 Behold, a son shall be born to thee, who shall be a man of rest; and I will give him rest from all his enemies round about: for his name shall be Solomon, and I will give peace and quietness unto Israel in his days.
10 He shall build an house for my name; and he shall be my son, and I will be his father; and I will establish the throne of his kingdom over Israel for ever.
11 Now, my son, the Lord be with thee; and prosper thou, and build the house of the Lord thy God, as he hath said of thee.
12 Only the Lord give thee wisdom and understanding, and give thee charge concerning Israel, that thou mayest keep the law of the Lord thy God.
13 Then shalt thou prosper, if thou takest heed to fulfil the statutes and judgments which the Lord charged Moses with concerning Israel: be strong, and of good courage; dread not, nor be dismayed.
14 Now, behold, in my trouble I have prepared for the house of the Lord an hundred thousand talents of gold, and a thousand thousand talents of silver; and of brass and iron without weight; for it is in abundance: timber also and stone have I prepared; and thou mayest add thereto.
15 Moreover there are workmen with thee in abundance, hewers and workers of stone and timber, and all manner of cunning men for every manner of work.
16 Of the gold, the silver, and the brass, and the iron, there is no number. Arise therefore, and be doing, and the Lord be with thee.
17 David also commanded all the princes of Israel to help Solomon his son, saying,
18 Is not the Lord your God with you? and hath he not given you rest on every side? for he hath given the inhabitants of the land into mine hand; and the land is subdued before the Lord, and before his people.
19 Now set your heart and your soul to seek the Lord your God; arise therefore, and build ye the sanctuary of the Lord God, to bring the ark of the covenant of the Lord, and the holy vessels of God, into the house that is to be built to the name of the Lord.
21 And Satan stood up against Israel, and provoked David to number Israel.
2 And David said to Joab and to the rulers of the people, Go, number Israel from Beersheba even to Dan; and bring the number of them to me, that I may know it.
3 And Joab answered, The Lord make his people an hundred times so many more as they be: but, my lord the king, are they not all my lord's servants? why then doth my lord require this thing? why will he be a cause of trespass to Israel?
4 Nevertheless the king's word prevailed against Joab. Wherefore Joab departed, and went throughout all Israel, and came to Jerusalem.
5 And Joab gave the sum of the number of the people unto David. And all they of Israel were a thousand thousand and an hundred thousand men that drew sword: and Judah was four hundred threescore and ten thousand men that drew sword.
6 But Levi and Benjamin counted he not among them: for the king's word was abominable to Joab.
7 And God was displeased with this thing; therefore he smote Israel.
8 And David said unto God, I have sinned greatly, because I have done this thing: but now, I beseech thee, do away the iniquity of thy servant; for I have done very foolishly.
9 And the Lord spake unto Gad, David's seer, saying,
10 Go and tell David, saying, Thus saith the Lord, I offer thee three things: choose thee one of them, that I may do it unto thee.
11 So Gad came to David, and said unto him, Thus saith the Lord, Choose thee
12 Either three years' famine; or three months to be destroyed before thy foes, while that the sword of thine enemies overtaketh thee; or else three days the sword of the Lord, even the pestilence, in the land, and the angel of the Lord destroying throughout all the coasts of Israel. Now therefore advise thyself what word I shall bring again to him that sent me.
13 And David said unto Gad, I am in a great strait: let me fall now into the hand of the Lord; for very great are his mercies: but let me not fall into the hand of man.
14 So the Lord sent pestilence upon Israel: and there fell of Israel seventy thousand men.
15 And God sent an angel unto Jerusalem to destroy it: and as he was destroying, the Lord beheld, and he repented him of the evil, and said to the angel that destroyed, It is enough, stay now thine hand. And the angel of the Lord stood by the threshingfloor of Ornan the Jebusite.
16 And David lifted up his eyes, and saw the angel of the Lord stand between the earth and the heaven, having a drawn sword in his hand stretched out over Jerusalem. Then David and the elders of Israel, who were clothed in sackcloth, fell upon their faces.
17 And David said unto God, Is it not I that commanded the people to be numbered? even I it is that have sinned and done evil indeed; but as for these sheep, what have they done? let thine hand, I pray thee, O Lord my God, be on me, and on my father's house; but not on thy people, that they should be plagued.
18 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.
19 And David went up at the saying of Gad, which he spake in the name of the Lord.
20 And Ornan turned back, and saw the angel; and his four sons with him hid themselves. Now Ornan was threshing wheat.
21 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.
22 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.
23 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.
24 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.
25 So David gave to Ornan for the place six hundred shekels of gold by weight.
26 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.
27 And the Lord commanded the angel; and he put up his sword again into the sheath thereof.
28 At that time when David saw that the Lord had answered him in the threshingfloor of Ornan the Jebusite, then he sacrificed there.
29 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.
30 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.