كتاب الحج
15  
The Book of Pilgrimage
(72)
Chapter: Validity of a child's hajj, and the reward of the one who takes him for Hajj
(72)
باب صِحَّةِ حَجِّ الصَّبِيِّ وَأَجْرِ مَنْ حَجَّ بِهِ ‏‏
Sahih Muslim 1336 a

Ibn Abbas reported that Allah's Apostle (ﷺ) met some riders at al-Rauha and asked who they were. They replied that they were Muslims. They said:

Who art thou? He said: (I am) Messengef of Allah. A woman (then) lifted up a boy to him and said: Would this child be credited with having performed the Hajj? Thereupon he said: Yes, and you will have a reward.
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَزُهَيْرُ بْنُ حَرْبٍ، وَابْنُ أَبِي عُمَرَ، جَمِيعًا عَنِ ابْنِ، عُيَيْنَةَ - قَالَ أَبُو بَكْرٍ حَدَّثَنَا سُفْيَانُ بْنُ عُيَيْنَةَ، - عَنْ إِبْرَاهِيمَ بْنِ عُقْبَةَ، عَنْ كُرَيْبٍ، مَوْلَى ابْنِ عَبَّاسٍ عَنِ ابْنِ عَبَّاسٍ، عَنِ النَّبِيِّ صلى الله عليه وسلم لَقِيَ رَكْبًا بِالرَّوْحَاءِ فَقَالَ ‏"‏ مَنِ الْقَوْمُ ‏"‏ ‏.‏ قَالُوا الْمُسْلِمُونَ ‏.‏ فَقَالُوا مَنْ أَنْتَ قَالَ ‏"‏ رَسُولُ اللَّهِ ‏"‏ ‏.‏ فَرَفَعَتْ إِلَيْهِ امْرَأَةٌ صَبِيًّا فَقَالَتْ أَلِهَذَا حَجٌّ قَالَ ‏"‏ نَعَمْ وَلَكِ أَجْرٌ ‏"‏ ‏.‏
Reference : Sahih Muslim 1336a
In-book reference : Book 15, Hadith 457
USC-MSA web (English) reference : Book 7, Hadith 3091
  (deprecated numbering scheme)