Urwah (may Allah have mercy on him) said: We were on a journey with Sayyiduna Abdullah bin al-Arqam al-Zuhri (may Allah be pleased with him), and the time for prayer came. He used to lead us in prayer. He gave us permission (to wait) and went out to relieve himself. It was said to him: If only you had led the prayer first and then gone. He said: I heard the Messenger of Allah (peace and blessings be upon him) say: "When the time for prayer comes and one of you needs to relieve himself, let him do that first, then pray afterwards; and let him not come to the prayer while he is holding it back (the need to relieve himself)."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 14063