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