Ali bin Abu Talib reported,

While we were with the Messenger of Allah ﷺ performing the prayer, he turned away while we remained standing. Then he came back with water dripping from his head and led us in the prayer. Afterward, he said, "I remembered that I was in a state of major impurity when I stood up to pray and had not yet bathed. So whoever among you feels a rumbling in his stomach, or finds himself in the condition I was in, let him leave until he relieves himself or completes his bath, then return to his prayer."

Ahmad 668

Daif

حدثنا حسن بن موسى حدثنا ابن لهيعة حدثنا الحارث بن يزيد عن عبد الله بن زرير الغافقي

عن علي بن أبي طالب رضي الله عنه قال

بينما نحن مع رسول الله ﷺ نصلي إذ انصرف ونحن قيام ثم أقبل ورأسه يقطر فصلى لنا الصلاة ثم قال إني ذكرت أني كنت جنبا حين قمت إلى الصلاة لم أغتسل فمن وجد منكم في بطنه رزا أو كان على مثل ما كنت عليه فلينصرف حتى يفرغ من حاجته أو غسله ثم يعود إلى صلاته

أحمد 668ضعيف
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Ali bin Abu Talib
Numbering
Darussalam 668
Ahmad 668