Abu Umama reported God’s Messenger as saying, “Make a practice of getting up at night, for it was the custom of the pious before you, is a means of bringing you near to your Lord, an atonement for evil deeds and a preventative of sin."
‘Amr b. ‘Abasa reported God's Messenger as saying, “The nearest the Lord comes to a servant is in the course of the last part of the night, so if you are able to be among those who make mention of God at that hour, do so."
Tirmidhi transmitted it, saying that this is a hasan sahih tradition whose isnad is gharib.
‘A’isha said that he, meaning God’s Messenger, would sleep in the early part of the night and keep awake in the latter part. If he then wished intercourse with his wife he satisfied his desire, and then went to sleep. If he was sexually defiled when the first call to prayer was made, he would get up and pour water on it, but if not, he performed the ablution for the prayer and then prayed two rak'as.