1 Chronicles 21:12

Either three years’ famine; or three months to be destroyed before thy foes, while that the sword of thine enemies overtaketh thee; or else three days the sword of the LORD, even the pestilence, in the land, and the angel of the LORD destroying throughout all the coasts of Israel. Now therefore advise thyself what word I shall bring again to him that sent me.

After David sinned greatly by ordering the census of Israel, an act prompted by pride and ambition, God sent the prophet Gad to offer him a choice of punishments. The offer was three judgments: three years of famine, three months of being destroyed before his foes while the sword of his enemies overtook him, or three days of pestilence by the sword of the Lord with the angel of the Lord destroying throughout all the coasts of Israel. Gad told David to advise himself and choose what answer Gad should bring back to God who sent him. David chose to fall into the hands of God rather than into the hands of cruel men.

Pestilence followed and killed seventy thousand, until God ordered the angel to stop before destroying Jerusalem. At Ornan's threshing floor David sought to stop the avenging sword through burnt offerings and peace offerings, which God answered by fire from heaven, turning aside the destroying angel's sword. The turning aside of the destroying sword through that sacrifice is a symbol of the Saviour's sacrifice and mediation for guilty people.