Short answer
Yes. Tahajjud time lasts until true dawn, when Fajr begins, and the last part of the night just before Fajr is the best time of all. Once Fajr time has started, stop: in the Hanafi school no nafl is prayed after dawn except the two sunnah rakats of Fajr. Whether 4am is still night depends on your Fajr time.
Tahajjud may be prayed any time after Isha until true dawn, and the last third of the night is best. After dawn, any nafl beyond the two sunnah of Fajr is makruh, so tahajjud and witr must be finished before Fajr begins; a witr missed this way is made up as qada.
Other madhhabs
- Shafi'i
- The disliked time for nafl begins only after the Fajr fard has been prayed, so nafl between dawn and the Fajr prayer is allowed; but the night prayer itself ends at dawn.
Explanation
The night prayer is best in the last third of the night. The Prophet ﷺ said Allah descends to the lowest heaven when the last third remains and asks who is calling on Him so that He may answer. So praying tahajjud shortly before Fajr is not just allowed, it is ideal.
The hard stop is true dawn, the start of Fajr on your timetable. Do not go by the masjid's Fajr adhan or iqamah if they are later. Whether 4am is still night depends on the season and where you live: in summer at high latitudes Fajr can start well before 4am. Check tahajjud time tonight for your city.
- Witr: if you saved witr for after tahajjud, pray it before Fajr begins. If Fajr comes in first, it becomes qada.
- Short of time: two quick rakats and witr are better than none.
- After Fajr begins: pray only the two sunnah of Fajr, then the fard.
- In Ramadan: leave time for suhoor before Fajr.
For the method, read how to pray tahajjud. For whether you must sleep first, see is tahajjud sunnah or nafl.
The evidence
Quran, Surah Adh-Dhaariyat 51:17-18
كَانُوا۟ قَلِيلًۭا مِّنَ ٱلَّيْلِ مَا يَهْجَعُونَ ﴿١٧﴾ وَبِٱلْأَسْحَارِ هُمْ يَسْتَغْفِرُونَ ﴿١٨﴾
They used to sleep but little of the night, And in the hours before dawn they would ask forgiveness,
The hours before dawn are praised as the time of night worship.
Sahih al-Bukhari 1145
Sahih... ينزل ربنا تبارك وتعالى كل ليلة إلى السماء الدنيا حين يبقى ثلث الليل الآخر ...
"Our Lord descends every night to the lowest heaven when the last third of the night remains."
The last third of the night, just before Fajr, is the best time.
Sahih Muslim 749
Sahih... فإذا خشي أحدكم الصبح صلى ركعة واحدة توتر له ما قد صلى ...
"When one of you fears the dawn, let him pray witr to close what he has prayed."
Night prayer and witr end at dawn.
Where the ruling is recorded
- Radd al-Muhtar (Ibn Abidin), Kitab al-Salah, chapter on witr and nawafil. Night prayer is recommended and best in the last part of the night.
- Nur al-Idah with Maraqi al-Falah, Chapter on the times in which prayer is disliked. After dawn, voluntary prayer beyond the two sunnah of Fajr is disliked.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.