Narrated Abdullah ibn Amr ibn al-As: The Prophet ﷺ said: When the Imam completes the prayer and sits (for reciting tashahhud), and then becomes defiled (i. e. his ablution becomes void) before he speaks (to someone), his prayer becomes complete. And those who prayed behind him also complete the prayer.
Narrated Ali ibn Abu Talib: The Prophet ﷺ said: The key of prayer is purification; takbir (saying "Allah is most great") makes (all acts which break prayer) unlawful and taslim (uttering the salutation) makes (all such acts) lawful.
Hadith Referenceسنن ابي داود / كتاب الصلاة / 618
Hadith Gradingالألبانی:حسن صحيح | زبیر علی زئی:حسن, ابن عقيل ضعفه الجمھور وللحديث شواھد كثيرة منھا قول ابن مسعود رضي الله عنه، رواه البيهقي (2/ 16) وسنده صحيح وله حكم المرفوع، فالحديث حسن
Hadith Takhrij« سنن الترمذی/الطھارة 3 (3)، سنن ابن ماجہ/الطھارة 3 (275)، (تحفة الأشراف: 10265)، وقد أخرجہ: مسند احمد (1/123)، سنن الدارمی/الطھارة 21 (713) (حسن صحیح) »