Anas bin Malik reported,

The Prophet ﷺ was praying one night in his chamber when some people came and joined his prayer. He shortened it, then went inside the house. He came out again, and this happened several times, each time he was praying.In the morning, they said, "Messenger of Allah, you prayed while we wished you would lengthen your prayer."He replied, "I knew you were there, and I did that deliberately."

Ahmad 12005

Sahih

حدثنا محمد بن أبي عدي عن حميد

عن أنس

أن النبي ﷺ كان يصلي ذات ليلة في حجرته فجاء أناس فصلوا بصلاته فخفف فدخل البيت ثم خرج فعاد مرارا كل ذلك يصلي فلما أصبح قالوا يا رسول الله صليت ونحن نحب أن تمد في صلاتك قال قد علمت بمكانكم وعمدا فعلت ذلك

أحمد 12005صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Anas bin Malik
Numbering
Darussalam 12005
Ahmad 12005