Someone remembered that he became junub whilst he was travelling for his first Hajj, and when he reached the miqaat he forgot that he was junub and he did ghusl for ihram only, and he did not intend to do ghusl for janaabah. Thus he entered ihram for Hajj and did not intend to do ghusl for janaabah. Does that count for both ihram and ghusl from janaabah?.
Praise be to Allaah.
His ghusl for ihram is sufficient to include his ghusl from janaabah, because it is a ghusl that is prescribed, especially in the case of someone who forgot. This was stated by the fuqaha’ when they said: “If he intends to do a Sunnah ghusl, it counts for the obligatory ghusl too.” Some of them limited it to the case of forgetfulness. As both opinions are applicable in the case of the man mentioned, it is acceptable in his case. End quote.
Majmoo‘ Fataawa Ibn ‘Uthaymeen, 22/373, 374.