It is narrated from Ibn Abbas (may Allah be pleased with them both) that when the Prophet ﷺ returned and met some riders at the place of Rauha, he ﷺ greeted them with salam and asked: "Who are you people?" They replied: "We are Muslims, and who are you people?" He ﷺ said: "I am the Messenger of Allah." A woman lifted her child in her hands from the litter and said: "O Messenger of Allah! Is there Hajj (valid) for this child?" He ﷺ replied: "Yes, and the reward is for you."
Hadith Referenceمسند الإمام الشافعي / كتاب الحج / 937
Hadith Takhrijأخرجہ مسلم، الحج، باب صحة حج الصبی، واجر من حج بہ (1336)۔