The Messenger of Allah (ﷺ) used to observe I'tikaf in the mosque and put his head near me through the opening of the apartment, and I would wash his head. Musaddad said: "And I would comb it while I was menstruating."
Sunan Abi Dawud Book 14, Hadith 157