It was narrated that Ibn ‘Abbaas (radiyAllaahu 'anhu) said: A woman lifted up a child of hers and said: O Messenger of Allaah, is there Hajj for this one? He (sallAllaahu 'alayhi wa sallm) said: “Yes, and you will have the reward.” [Sahih Muslim (2378)] Al-Nawawi said in Sharh Muslim: This is used as evidence by al-Shaafa’i, Maalik, Ahmad and the majority of scholars that the Hajj of a child counts and is valid, and he will be rewarded for it, but it does not count as the Hajj of Islam (the obligatory Hajj), rather it is regarded as a voluntary Hajj. This hadeeth clearly states that.