David built there an altar to Yahweh, and offered burnt offerings and peace-offerings, and called on Yahweh; and he answered him from the sky by fire on the altar of burnt offering.
David’s response to Gad’s instructions indicated his true repentance. He left the decision about punishment entirely in God’s hands and did not seek to control it.