"I asked 'Aishah: 'How did the Messenger of Allah (ﷺ) sleep while he was Junub? Did he perform Ghusl before sleeping or sleep before performing Ghusl?' She said: 'He did both. Sometimes he would perform Ghusl then sleep, and sometimes he would perform Wudu' then sleep.'"
Sunan an-Nasa'i Book 4, Hadith 9