It seems like it would be safe to assume that Samuel, the prophet who anointed both Saul and David to be the first two kings of Israel, would be the writer of these two books. However, upon closer examination of the text, you will find that Samuel actually died at the beginning of 1 Samuel 25. This means that he died thirty-one chapters too soon to be the penman of both books.
The two books of Samuel are the clearest, fullest and most informative documents of the life of David we have in existence today. So who was this historic scribe? Well, the truth of the matter was that this was actually a joint effort between the following three individuals:
How do we know this? 1 Chronicles 29:29-30 says:
29 Now the acts of King David, from first to last, are written in the Chronicles of Samuel the seer, and in the Chronicles of Nathan the prophet, and in the Chronicles of Gad the seer, 30 with accounts of all his rule and his might and of the circumstances that came upon him and upon Israel and upon all the kingdoms of the countries.