Abd al-Malik bin al-Rabi' bin Sabrah narrates from his father, and he from his grandfather (may Allah be pleased with him), that the Messenger of Allah (peace and blessings be upon him) said: "Teach children the prayer when they are seven years old, and at the age of ten make them pray, even by smacking them."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5091