It was the practice of the Prophet (peace and blessings be upon him):
"When he (peace and blessings be upon him) intended to relieve himself, he would go far away."
Hadith Referenceصحیح الجامع الصغیر / حرف الكاف / 4651
Hadith Gradingالألبانی:صحيح
Hadith Takhrij[هـ] عن بلال بن الحارث [حم ن هـ] عن عبد الرحمن بن أبي قراد. صحيح أبي دأود: ١١.