Gad first appears while David was fleeing from King Saul. David had taken refuge in the stronghold, but Gad instructed him not to remain there and to return to the land of Judah. David obeyed and went to the forest of Hereth.
Gad later served as a prophetic adviser during David's reign. After David ordered a census of Israel, David recognized that he had sinned. The Lord sent Gad to offer David a choice among three forms of judgment (2 Samuel 24:11-13). David chose to fall into the hands of the Lord rather than into human hands.
A plague followed, but as judgment approached Jerusalem the Lord showed mercy and restrained the destroying angel. Gad then instructed David to erect an altar to the Lord on the threshing floor of Araunah the Jebusite. David purchased the site, built the altar, and offered sacrifices.
The location later became associated with the site of the Temple. Gad is also named, along with Samuel and Nathan, as one of the prophetic sources recording the events of David's reign (1 Chronicles 29:29).