Satan stood up against Israel and incited David to count [the people of] Israel.
References for 1 Chronicles 21:1
So David said to Joab and the commanders of the troops, "Go and count Israel from Beer-sheba to Dan and bring [a report] to me so I can know their number."
Joab replied, "May the Lord multiply the number of His people a hundred times over! My lord the king, aren't they all my lord's servants? Why does my lord want to do this? Why should he bring guilt on Israel?"
Yet the king's order prevailed over Joab. So Joab left and traveled throughout Israel and then returned to Jerusalem.
Joab gave David the total of the registration of the troops. In all Israel there were 1,100,000 swordsmen and in Judah itself 470,000 swordsmen.