Maliks Muwatta Book 9, Hadith Number 52.

Section : Prohibition against a Man Praying when Wishing to Relieve Himself.

Yahya related to me from Malik from Hisham ibn Urwa from his father that Abdullah ibn al-Arqam used to lead his companions in prayer. The time for prayer came one day and he went to relieve himself. When he returned, he said, “I heard the Messenger of Allah, may Allah bless him and grant him peace, say, ‘If you wish to defecate, you should do so before the prayer.'”