After I had finished the farewell tawaf (circumambulation) and returned to Jeddah, I found a trace of impurity on my underwear, as it got into the anus. What is the ruling on this, knowing that I reside in the city of Jeddah?
All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
It seems that the tawaf is valid—Allah willing—and the impurity that you found after having performed tawaf or prayer does not affect the validity of the relevant act of worship, whether it is tawaf or prayer.
However, we draw your attention to the importance of purification from urine and impurities in general because abandoning purification from urine leads to the invalidity of the acts of worship that depend upon purity, and it also causes a person to be punished in his grave. It has been narrated on the authority of Abu Hurayrah in a marfoo' (directly attributed to the prophet, sallallaahu ‘alayhi wa sallam) hadith that the Prophet, sallallaahu ‘alayhi wa sallam, said: “Purify yourselves from urine because it is the main cause of punishment in the grave.” [Abu Daawood, An-Nasaa’i, At-Tirmithi and Ibn Maajah; Ibn Khuzaymah: Saheeh]
Allah Knows best.
You can search for fatwa through many choices