كتاب الحج
15  
The Book of Pilgrimage
(55)
Chapter: Shaving the head is preferrable to cutting the hair, although cutting the hair is permissible
(55)
باب تَفْضِيلِ الْحَلْقِ عَلَى التَّقْصِيرِ وَجَوَازِ التَّقْصِيرِ ‏‏
Sahih Muslim 1301 d

Ubaidullah reported this hadith with the same chain of transmitters and (it is said) that it was on the fourth turn that he (the Holy Prophet) said:

(May Allah have mercy upon) those who got their hair clipped."
وَحَدَّثَنَاهُ ابْنُ الْمُثَنَّى، حَدَّثَنَا عَبْدُ الْوَهَّابِ، حَدَّثَنَا عُبَيْدُ اللَّهِ، بِهَذَا الإِسْنَادِ وَقَالَ فِي الْحَدِيثِ فَلَمَّا كَانَتِ الرَّابِعَةُ قَالَ ‏ "‏ وَالْمُقَصِّرِينَ ‏"‏ ‏.‏
Reference : Sahih Muslim 1301d
In-book reference : Book 15, Hadith 351
USC-MSA web (English) reference : Book 7, Hadith 2986
  (deprecated numbering scheme)