The Messenger of Allah ﷺ said, "Let the beards grow and trim the moustaches."
حدثنا حماد حدثنا مالك عن نافع
قال رسول الله ﷺ أعفوا اللحى وحفوا الشوارب
Its isnad is sahih, but this particular isnad presents a problem.As for its soundness, the hadith was narrated earlier by Ahmad in 4654 from Yahya bin Saeed Qattan, from Ubaydullah, from Nafi, from Ibn Umar, as a marfu report, "Trim the mustaches closely, and let the beards grow." It was likewise narrated by Muslim (1:87) through Yahya Qattan and Ibn Numayr, by Tirmidhi (4:11-12) through Ibn Numayr, by Abu Awana in his Sahih (1:189) through Muhammad bin Bishr and Ibn Numayr, and by Khatib in Tarikh Baghdad (4:345) through Muhammad bin Bishr, all of them from Ubaydullah, from Nafi, from Ibn Umar, with this same wording.As for the problem, it lies in his narration here from Malik, from Nafi, from Ibn Umar. Malik narrated in the Muwatta (3:123, or 4:162 in Zurqani's commentary) from Abu Bakr bin Nafi, from his father Nafi, from Abdullah bin Umar, that the Messenger of Allah ﷺ commanded that mustaches be trimmed closely and beards be left to grow. Ibn Abdul-Barr likewise transmitted this in Taqassi (no. 779) from Malik. It was also narrated by Muslim (1:87) through the transmission of Qutayba, by Abu Dawud (4:135) through the transmission of Qanabi, by Tirmidhi (4:12) through the transmission of Maen, and by Abu Awana in his Sahih (1:189) through Ibn Wahb and Mutarrif, and also through Abdullah bin Yusuf, all of them from Malik, from Abu Bakr bin Nafi, from his father, with this same content, in the form of a narrated report, "He commanded that mustaches be trimmed closely," and so on.Khatib narrated it in Tarikh Baghdad (6:247) in abbreviated form, through Ismail bin Ibrahim, from Malik, with the wording, "The Messenger of Allah ﷺ said, 'Let the beards grow.'" I think Khatib's narration conveys the meaning as understood by one of his teachers rather than the exact wording.The problem, however, is that all these trustworthy narrators transmitted it from Malik, from Abu Bakr bin Nafi, from his father Nafi, which indicates that Malik did not hear it directly from his teacher Nafi, but rather transmitted it from him through his son Abu Bakr bin Nafi. Yet here, this Hammad bin Khalid transmits it from Malik, from Nafi, directly, and moreover presents it as a spoken hadith, a saying of the Messenger of Allah ﷺ.Hammad is trustworthy, as we established his reliability earlier at 1824. Indeed, Abu Zura said of him, "A meticulous shaykh," and Hasan bin Arafah said, "He was among the best of those we encountered." It appears, then, that he made a mistake and forgot, transmitting it from Malik along the usual path, Malik from Nafi, without noticing that this particular report was not something Malik heard directly from Nafi, but rather something he heard from Abu Bakr bin Nafi.As for his presenting it as a spoken hadith, that is a minor matter, it may simply be a paraphrase conveying the meaning, similar to Ismail bin Ibrahim's narration as found in Khatib's account, especially since it is likewise narrated through Ubaydullah from Nafi, as we have shown. Indeed, it appears three more times earlier in the Musnad, at 5135, 5138, and 5139, through Thawri from Abdul-Rahman bin Alqama, appearing in the first of these as a spoken saying, and in the other two as, "The Messenger of Allah ﷺ commanded..."His saying, "and trim the mustaches closely," appears in a manuscript in the margin of م as "wa ahfu," see also 5988.