The Prophet of Allah, peace and blessings be upon him, said, "I begin the prayer intending to prolong it, but then I hear a child crying, so I shorten my prayer, knowing how distressed his mother becomes at his crying."
حدثنا ابن أبي عدي عن سعيد وابن جعفر وعبد الوهاب الخفاف عن سعيد عن قتادة
أن نبي الله عليه الصلاة والسلام قال إني لأدخل الصلاة وأنا أريد أن أطيلها فأسمع بكاء الصبي فأتجاوز في صلاتي مما أعلم من شدة وجد أمه من بكائه
Its isnad is sahih. Bukhari narrated it, 2/202, no. 709, Fath, adhan chapter, on shortening the prayer when a child cries, and Muslim, 1/343/470, in the book of prayer, on commanding prayer leaders to shorten the prayer.