"The Prophet (ﷺ) forbade praying after the Fajr prayer till the sun rises and after the `Asr prayer till the sun sets."
Narrated Ibn `Abbas:
Some people told me the same narration (as above).
Times of the Prayers
Sahih al-Bukhari 581
Prohibition of Prayer During Sunrise and Sunset
This hadith establishes two prohibited times for voluntary prayers: after Fajr until sunrise, and after Asr until sunset. These times are known as "karahat" (disliked times) when nafl (supererogatory) prayers are forbidden.
Scholarly Commentary
The wisdom behind this prohibition lies in avoiding resemblance to sun-worshippers who prostrate to the sun during these times. Furthermore, these are moments of celestial transition when angels change shifts, making it inappropriate for additional worship.
This ruling applies specifically to voluntary prayers. Obligatory prayers, missed prayers (qada), and funeral prayers remain permissible during these times according to the majority of scholars.
The duration of prohibition after Fajr extends until the sun has fully risen and becomes distinct, while after Asr it continues until the sun has completely set below the horizon.
Exceptions to the Rule
Scholars mention exceptions including: praying in the Haram (Sacred Mosque in Mecca), making up missed obligatory prayers, performing the two rak'ahs after tawaf (circumambulation), and prostrations of recitation (sujud at-tilawah).