Does a brownish discharge have any effect on Hajj and ‘Umrah?
Question

I was two month pregnant and I miscarried two days before I went for Hajj. I was taahir (pure) except that on the day of al-Tarwiyah, that night I saw a few dark spots that were like the spotting in the last days of the monthly period, i.e., they were not blood but were a dirty brown. But I completed my Hajj. Is my Hajj valid?.
Praise be to Allah.The spots that you saw do not affect your Hajj or ‘Umrah, because they are not menstrual blood or postpartum bleeding (nifaas), rather they were spots that are called al-kadrah (brownish discharge). The ruling on these spots is that wudoo’ is required according to the majority of scholars. If you did wudoo’ when you did tawaaf al-ifaadah, then your tawaaf is valid according to the majority of scholars. If you did not do wudoo’ then there is a difference of scholarly opinion: is tawaaf valid if a person has not purified himself, or not? 
This has been discussed in the answer to question no. 34695. The view favoured by Shaykh al-Islam Ibn Taymiyah and Shaykh Ibn ‘Uthaymeen is that it is not essential. 
Shaykh Muhammad ibn Saalih al-‘Uthaymeen (may Allah have mercy on him) said: 
What comes after purification (from menses) such as brownish or yellowish discharge, or spotting, or wetness, is not menses, so it does not mean that a woman is not allowed to pray or fast, or that a man is not allowed to have intercourse with his wife, because it is not menses.
Umm ‘Atiyyah said: “We did not regard the yellowish or brownish discharge as being anything significant.” Narrated by al-Bukhaari. Abu Dawood added: “after becoming pure.” Its isnaad is saheeh. Based on this, we say: Everything that happened after being sure that the period was over does not affect a woman or mean that she is not allowed to pray or fast or that her husband is not allowed to be intimate with her. But she should not rush until she sees the tuhr (white discharge indicating the end of menses), because some women, when the bleeding lessens, hasten to do ghusl before they see the tuhr. Hence the women of the Sahaabah used to send pieces of cotton on which there was blood to ‘Aa’ishah, and she would say to them, “Do not rush until you see the white discharge.” End quote. 
60 Su’aalan ‘an Ahkaam al-Hayd (question no. 24). 
Conclusion: Your Hajj is valid in sha Allah, and these spots are not menses or nifaas. 
And Allah knows best.