2 Samuel 24:10 in the King James Version
And David’s heart smote him after that he had numbered the people. And David said unto the LORD, I have sinned greatly in that I have done: and now, I beseech thee, O LORD, take away the iniquity of thy servant; for I have done very foolishly.
Context
9 Joab gave up the sum of the counting of the people to the king; and there were in Israel eight hundred thousand valiant men who drew the sword, and the men of Judah were five hundred thousand men.
10 David’s heart struck him after he had counted the people. David said to the LORD, “I have sinned greatly in that which I have done. But now, the LORD, put away, I beg you, the iniquity of your servant; for I have done very foolishly.”
11 When David rose up in the morning, the LORD’s word came to the prophet Gad, David’s seer, saying,