2 Samuel 24:17-18 (YLT)
17 And David speaketh unto Jehovah, when he seeth the messenger who is smiting among the people, and saith, ‘Lo, I have sinned, yea, I have done perversely; and these--the flock--what have they done? Let, I pray Thee, Thy hand be on me, and on the house of my father.'
18 And Gad cometh in unto David on that day, and saith to him, ‘Go up, raise to Jehovah an altar in the threshing-floor of Araunah the Jebusite;'
About 2 Samuel 24: The chapter closes the book with a hard lesson about trust. The Lord is angry with Israel, and He permits David to count the people (verse 1). This census was not just a headcount for taxes or armies. It showed David looking at his own power instead of God’s provision. Joab warns him, but David insists on sending the men out to number every tribe from Beersheba to Dan (verses 3-9). When the count is done, David’s heart smites him. He admits he has done a foolish thing and asks for forgiveness (verse 10). Read the study notes
2 verses · Compare in parallel · Read all of 2 Samuel 24