Sayyiduna Imran bin Husayn (may Allah be pleased with him) narrates: We were travelling with the Prophet (peace and blessings be upon him). A man became sexually impure (junub) and did not find water, yet he performed the prayer. Then, within the time of that same prayer, he reached water, and the man took a ritual bath (ghusl), but the Prophet (peace and blessings be upon him) did not order him to repeat the prayer.
Al-Tabarani recorded it in al-Mu'jam al-Kabir; its chain contains Isma'il bin Muslim al-Makki, who is da'if (weak).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الطهارة / 1429