Sayyiduna Anas bin Malik (may Allah be pleased with him), commenting on the saying of Allah Almighty: "Nor when in a state of major impurity, except when passing through" [Surah al-Nisa: 43], said: A person in a state of major impurity should not approach the prayer, except a traveller; he may pass through, but it is not proper for him to sit.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 4328