And David said to God, "Was it not I who commanded the people to be numbered? I am the one who has sinned and done evil indeed; but these sheep, what have they done? Let Your hand, I pray, O LORD my God, be against me and my father's house, but not against Your people that they should be plagued."
1 Chronicles 21:17
Surrounding context
21:16 Then David lifted his eyes and saw the angel of the LORD standing between earth and heaven, having in his hand a drawn sword stretched out over Jerusalem. So David and the elders, clothed in sackcloth, fell on their faces.
21:17 And David said to God, "Was it not I who commanded the people to be numbered? I am the one who has sinned and done evil indeed; but these sheep, what have they done? Let Your hand, I pray, O LORD my God, be against me and my father's house, but not against Your people that they should be plagued."
21:18 Therefore, the angel of the LORD commanded Gad to say to David that David should go and erect an altar to the LORD on the threshing floor of Ornan the Jebusite.