Abd al-Malik bin al-Rabi' bin Sabrah narrates from his father, through his grandfather (may Allah be pleased with him), that the Messenger of Allah (peace and blessings be upon him) said: "When a child reaches seven years of age, command him to pray, and when he reaches ten, beat him for not praying."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2253