In line with the Qur'anQur'an 17:78 ↗أَقِمِ ٱلصَّلَوٰةَ لِدُلُوكِ ٱلشَّمۡسِ إِلَىٰ غَسَقِ ٱلَّيۡلِ وَقُرۡءَانَ ٱلۡفَجۡرِۖ إِنَّ قُرۡءَانَ ٱلۡفَجۡرِ كَانَ مَشۡهُودٗا
Perform the prayer at the decline of the sun, until the darkness of the night; and the Quran at dawn. The Quran at dawn is witnessed.
The verse commands establishing prayer from the sun's decline to the darkness of night, a span that includes the sunset prayer the Prophet prayed promptly.
In line with the Qur'anQur'an 4:103 ↗فَإِذَا قَضَيۡتُمُ ٱلصَّلَوٰةَ فَٱذۡكُرُواْ ٱللَّهَ قِيَٰمٗا وَقُعُودٗا وَعَلَىٰ جُنُوبِكُمۡۚ فَإِذَا ٱطۡمَأۡنَنتُمۡ فَأَقِيمُواْ ٱلصَّلَوٰةَۚ إِنَّ ٱلصَّلَوٰةَ كَانَتۡ عَلَى ٱلۡمُؤۡمِنِينَ كِتَٰبٗا مَّوۡقُوتٗا
When you have completed the prayer, remember God, standing, or sitting, or on your sides. And when you feel secure, perform the prayer. The prayer is obligatory for believers at specific times.
The verse states that prayer is prescribed for believers at fixed times, matching the Prophet's keeping to the set time of the sunset prayer.
In line with the Qur'anQur'an 11:114 ↗وَأَقِمِ ٱلصَّلَوٰةَ طَرَفَيِ ٱلنَّهَارِ وَزُلَفٗا مِّنَ ٱلَّيۡلِۚ إِنَّ ٱلۡحَسَنَٰتِ يُذۡهِبۡنَ ٱلسَّيِّـَٔاتِۚ ذَٰلِكَ ذِكۡرَىٰ لِلذَّٰكِرِينَ
Perform the prayer at the borders of the day, and during the approaches of the night. The good deeds take away the bad deeds. This is a reminder for those who remember.
The verse commands establishing prayer at the two ends of the day, which includes the prayer at sunset.