1 Chronicles 21 recounts the story of David's ill-fated decision to conduct a census of Israel and Judah. Satan tempts David to take this action, which goes against God's will. David commands his officials to count the people, but Joab, his military commander, advises against it. Despite Joab's warning, David insists, and the census is carried out.
Afterward, David realizes the gravity of his sin and repents. God sends the prophet Gad to offer David three choices for punishment: three years of famine, three months of devastation by enemies, or three days of plague. David chooses the plague, trusting in God's mercy rather than the hands of his enemies.
The plague devastates Israel, resulting in the deaths of 70,000 people. As the angel of the Lord approaches Jerusalem to destroy it, God commands him to stop and informs David through the prophet Gad. David is directed to erect an altar on the threshing floor of Ornan the Jebusite. Ornan offers the land and the animals for the sacrifice, but David insists on paying the full price.
David offers burnt offerings and peace offerings on the altar, and God answers by sending fire from heaven to consume the offerings. The Lord's favor is restored, and the plague is lifted. David builds an altar there and offers sacrifices regularly.
