Answer
I say, and with God's success: Children, both boys and girls, are commanded to pray when they reach the age of seven, and they are to be lightly struck for it at the age of ten, with no more than three strikes with the hand; out of kindness to them, and as a form of admonition according to one's ability. The striking should be with the hand, not with a stick; because striking with a stick is for a wrongdoing committed by someone accountable, and there is no wrongdoing from a child. This striking is obligatory; for Sabrah (may Allah be pleased with him) said that the Messenger of Allah (peace be upon him) said: "Teach the child to pray at seven years old, and strike him for it at ten years old," in Sunan al-Tirmidhi 2: 259, and he said: it is good and authentic, and in Sahih Ibn Khuzaymah 2: 102, and in Al-Mustadrak 1: 389. And from Amr ibn Shu'aib from his father from his grandfather (may Allah be pleased with them) who said that the Messenger of Allah (peace be upon him) said: "Command them to pray at seven years old, and strike them for it at ten years old, and separate them in their beds," in Sunan al-Bayhaqi al-Kabir 2: 229, and Sunan al-Daraqutni 1: 231, and Al-Mu'jam al-Awsat 4: 256, and Musnad Ahmad 2: 187, and Musnad al-Harith 1: 238, and there is some discussion about its chain as mentioned in Talqih al-Habir 1: 185, and Nasb al-Rayah 1: 298, and Kashf al-Khafa 2: 266. Refer to: Hashiyat al-Tahawi p. 174, and Al-Maraqi pp. 173-174, and Allah knows best.