Sahih al-Bukhari Book 9, Hadith 72
The Prophet (ﷺ) said, "If anyone forgets a prayer he should pray that prayer when he remembers it. There
is no expiation except to pray the same." Then he recited: "Establish prayer for My (i.e. Allah's)
remembrance." (20.14).
On the day of Al-Khandaq (the battle of trench.) `Umar bin Al-Khattab came cursing the disbelievers of Quraish after the sun had set and said, "O Allah's Messenger (ﷺ) I could not offer the `Asr prayer till the sun had set." The Prophet (ﷺ) said, "By Allah! I, too, have not prayed." So we turned towards Buthan, and the Prophet (ﷺ) performed ablution and we too performed ablution and offered the `Asr prayer after the sun had set, and then he offered the Maghrib prayer.
`Umar came cursing the disbelievers (of Quraish) on the day of Al-Khandaq (the battle of Trench) and said, "I could not offer the `Asr prayer till the sun had set. Then we went to Buthan and he offered the (`Asr) prayer after sunset and then he offered the Maghrib prayer.