Praying Asr Or Fajr Just Before The Time Ends
The times of sunrise and sunset are prohibited for prayer because these moments were historically associated with sun‑worship. Out of concern for avoiding anything that resembles polytheistic practices, the Prophet (sws) emphasized strict observance of these prohibited periods. He therefore instructed that after performing Fajr, one should not pray again until the sun has risen, and after performing Asr, one should not pray until the sun has set ( https://sunnah.com/bukhari:586 ). For this reason, it is recommended not to delay Fajr close to sunrise or Asr close to sunset. However, from a legal standpoint, the valid time for Asr extends until sunset, and the valid time for Fajr extends until sunrise. Thus, if a person begins their prayer before the actual moment of sunrise or sunset, the prayer is legally valid ( https://sunnah.com/bukhari:579 ).