عَنْ عَبْدِ الْمَلِكِ بْنِ الرَّبِيعِ بْنِ سَبْرَةَ الْجُهَنِيِّ عَنْ أَبِيهِ عَنْ جَدِّهِ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ: ((إِذَا بَلَغَ الْغُلَامُ سَبْعَ سِنِينَ أُمِرَ بِالصَّلَاةِ، فَإِذَا بَلَغَ عَشْرًا ضُرِبَ عَلَيْهَا))
It is narrated from Sayyiduna Sabrah Juhani (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: When a child reaches the age of seven, he should be instructed to pray, and when he reaches the age of ten, he should be disciplined (beaten) for neglecting the prayer.