The Prophet ﷺ said, "When I start the prayer I intend 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 its mother's passions." (Using translation from Bukhārī 709)
أَنَّ النَّبِيَّ ﷺ قَالَ إِنِّي لَأَدْخُلُ فِي الصَّلَاةِ وَأَنَا أُرِيدُ أَنْ أُطِيلَهَا فَأَسْمَعُ بُكَاءَ الصَّبِيِّ فَأَتَجَوَّزُ فِي صَلَاتِي مِمَّا أَعْلَمُ مِنْ شِدَّةِ وَجْدِ أُمِّهِ مِنْ بُكَائِهِ