Hazrat ‘Ali (radhiyallahu ‘anhu) had not yet performed his ‘asr salaah when wahi (divine revelation) began to descend upon Rasulullah (sallallahu ‘alaihi wasallam). The revelation of wahi continued until sunset, after which Rasulullah (sallallahu ‘alaihi wasallam) asked Hazrat ‘Ali (radhiyallahu ‘anhu) whether he had performed his ‘asr salaah. When he replied in the negative, Rasulullah (sallallahu ‘alaihi wasallam) addressed Allah Ta‘ala in du‘aa saying, “O Allah! ‘Ali was in the obedience of Your Rasul (sallallahu ‘alaihi wasallam)! I beg You to return the sun so that he may perform his ‘asr salaah on time.”
Hazrat Asmaa (radhiyallahu ‘anha) mentions, “After the sun had already set, it re-emerged with its rays falling on the earth and the mountains.”
(Extracted from Seeratul Mustafa 1/239)