Anas bin Malik reported,

Muaz was leading his people in prayer when Haram came in, intending to water his palm trees. He entered the mosque to pray with the congregation, but when he saw that Muaz was prolonging the prayer, he shortened his own prayer and went off to water his palm trees.When Muaz finished his prayer, he was told that Haram had entered the mosque.

Ahmad 11982

Sahih

حدثنا إسماعيل حدثنا عبد العزيز بن صهيب عن أنس بن مالك وقال مرة أخبرنا عبد العزيز بن صهيب

عن أنس بن مالك قال

كان معاذ يؤم قومه فدخل حرام وهو يريد أن يسقي نخله فدخل المسجد ليصلي مع القوم فلما رأى معاذا طول تجوز في صلاته ولحق بنخله يسقيه فلما قضى معاذ صلاته قيل له إن حراما دخل المسجد

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