Bukhārī and Muslim reported in their Ṣaḥīḥ by way of Abū Qatādah, may God be pleased with him, who said: “I saw the Messenger of God, peace be upon him, leading the people in prayer with Umāmah b. Abū al-ʿĀs, the granddaughter of the Messenger, peace be upon him, from Zaynab on his shoulder. When he bowed, he put her down, and when he got up after prostration, he lifted her again.” In another narration of the same ḥadīth in the Sunan al-Nasā’ī, Abū Qatādah narrated, “While we were sitting in the mosque, the Messenger of God, peace be upon him, came out to us carrying Umāmah b. Abū al-ʿĀs b. al-Rabīʿ, the granddaughter of the Messenger, peace be upon him, from Zainab. She was a little girl and he was carrying her. The Messenger of God, peace be upon him, prayed with her on his shoulder, putting her down when he bowed and picking her up again when he stood up, until he completed his prayer.”
Bukhārī and Muslim also reported that the Messenger of God, peace be upon him, said: “I start the prayer intending to prolong it, but on hearing the cries of a child, I cut short the prayer because I know that the cries of the child will incite his mother’s sadness.” In one of the narrations of Muslim of this ḥadīth, Anas b. Mālik narrated: “The Messenger of God, peace be upon him, would listen to the crying of a child in the company of his mother while praying, and would then recite a short or light sūrah.” It is also recorded that the Prophet, peace be upon him, shortened the Fajr prayer one day. It was said to him, “O Messenger of God, why did you shorten it?” He responded, “I heard the cries of a child and assumed that his mother is praying with us and so I wanted to make his mother available to him.” This was reported by Aḥmad with a sound chain of transmission.
In another narration Shaddād, may God be pleased with Him, said, “The Messenger of God, peace be upon him, came out to us for one of the daytime prayers, either Ẓuhr or Aṣr, while carrying either Ḥasan or Ḥusayn. The Messenger of God, peace be upon him, came forward and placed him down near his feet. He then recited the takbīr and commenced with prayer. He then prostrated and made the prostration lengthy. I raised my head and saw the child on the back of the Messenger of God, peace be upon him, while he was prostrating so I returned to a state of prostration. When the Messenger of God, peace be upon him, finished praying, the people said: ‘O Messenger of God, you prostrated during the prayer for so long that we thought that something had happened or that you were receiving revelation.’ He replied: ‘No such thing happened. But in fact, my son was riding on my back and I did not like to disturb him until he had his fill.’ This was reported by al-Nasā’ī and al-Ḥākim, who authenticated it.