Answer
✅Answer: Please pay attention to the following narrations:
1 قَالَ أَبُو جَعْفَر وَ إِنْ كُنْتَ قَدْ صَلَّيْتَ الظُّهْرَ وَ قَدْ فَاتَتْكَ الْغَدَاةُ فَذَكَرْتَهَا فَصَلِّ الْغَدَاةَ أَيَّ سَاعَةٍ ذَكَرْتَهَا وَ لَوْ بَعْدَ الْعَصْرِ وَ مَتَى مَا ذَكَرْتَ صَلَاةً فَاتَتْكَ صَلَّيْتَهَا وَ قَالَ إِذَا نَسِيتَ الظُّهْرَ حَتَّى صَلَّيْتَ الْعَصْرَ فَذَكَرْتَهَا وَ أَنْتَ فِي الصَّلَاةِ أَوْ بَعْدَ فَرَاغِكَ فَانْوِهَا الْأُولَى ثُمَّ صَلِّ الْعَصْرَ فَإِنَّمَا هِيَ أَرْبَعٌ مَكَانَ أَرْبَعٍ وَ إِنْ ذَكَرْتَ أَنَّكَ لَمْ تُصَلِّ الْأُولَى وَ أَنْتَ فِي صَلَاةِ الْعَصْرِ وَ قَدْ صَلَّيْتَ مِنْهَا رَكْعَتَيْنِ فَانْوِهَا الْأُولَى ثُمَّ صَلِّ الرَّكْعَتَيْنِ الْبَاقِيَتَيْنِ وَ قُمْ فَصَلِّ الْعَصْرَ وَ إِنْ كُنْتَ قَدْ ذَكَرْتَ أَنَّكَ لَمْ تُصَلِّ الْعَصْرَ حَتَّى دَخَلَ وَقْتُ الْمَغْرِبِ وَ لَمْ تَخَفْ فَوْتَهَا فَصَلِّ الْعَصْرَ ثُمَّ صَلِّ الْمَغْرِبَ فَإِنْ كُنْتَ قَدْ صَلَّيْتَ الْمَغْرِبَ فَقُمْ فَصَلِّ الْعَصْرَ وَ إِنْ كُنْتَ قَدْ صَلَّيْتَ مِنَ الْمَغْرِبِ رَكْعَتَيْنِ ثُمَّ ذَكَرْتَ الْعَصْرَ فَانْوِهَا الْعَصْرَ ثُمَّ قُمْ فَأَتِمَّهَا رَكْعَتَيْنِ ثُمَّ تُسَلِّمُ ثُمَّ تُصَلِّي الْمَغْرِبَ فَإِنْ كُنْتَ قَدْ صَلَّيْتَ الْعِشَاءَ الْآخِرَةَ وَ نَسِيتَ الْمَغْرِبَ فَقُمْ فَصَلِّ الْمَغْرِبَ وَ إِنْ كُنْتَ ذَكَرْتَهَا وَ قَدْ صَلَّيْتَ مِنَ الْعِشَاءِ الْآخِرَةِ رَكْعَتَيْنِ أَوْ قُمْتَ فِي الثَّالِثَةِ فَانْوِهَا الْمَغْرِبَ ثُمَّ سَلِّمْ ثُمَّ قُمْ فَصَلِّ الْعِشَاءَ الْآخِرَةَ فَإِنْ كُنْتَ قَدْ نَسِيتَ الْعِشَاءَ الْآخِرَةَ حَتَّى صَلَّيْتَ الْفَجْرَ فَصَلِّ الْعِشَاءَ الْآخِرَةَ وَ إِنْ كُنْتَ ذَكَرْتَهَا وَ أَنْتَ فِي الرَّكْعَةِ الْأُولَى أَوْ فِي الثَّانِيَةِ مِنَ الْغَدَاةِ فَانْوِهَا الْعِشَاءَ ثُمَّ قُمْ فَصَلِّ الْغَدَاةَ وَ أَذِّنْ وَ أَقِمْ وَ إِنْ كَانَتِ الْمَغْرِبُ وَ الْعِشَاءُ قَدْ فَاتَتَاكَ جَمِيعاً فَابْدَأْ بِهِمَا قَبْلَ أَنْ تُصَلِّيَ الْغَدَاةَ ابْدَأْ بِالْمَغْرِبِ ثُمَّ الْعِشَاءِ فَإِنْ خَشِيتَ أَنْ تَفُوتَكَ الْغَدَاةُ إِنْ بَدَأْتَ بِهِمَا فَابْدَأْ بِالْمَغْرِبِ ثُمَّ الْغَدَاةِ ثُمَّ صَلِّ الْعِشَاءَ وَ إِنْ خَشِيتَ أَنْ تَفُوتَكَ الْغَدَاةُ إِنْ بَدَأْتَ بِالْمَغْرِبِ فَصَلِّ الْغَدَاةَ ثُمَّ صَلِّ الْمَغْرِبَ وَ الْعِشَاءَ ابْدَأْ بِأَوَّلِهِمَا لِأَنَّهُمَا جَمِيعاً قَضَاءٌ أَيَّهُمَا ذَكَرْتَ فَلَا تُصَلِّهِمَا إِلَّا بَعْدَ شُعَاعِ الشَّمْسِ قَالَ قُلْتُ: وَ لِمَ ذَاكَ قَالَ لِأَنَّكَ لَسْتَ تَخَافُ فَوْتَهَا.
📚 Al-Kafi, vol. 3, p. 291
Imam al-Baqir (peace of God be upon him) said: If you prayed the Dhuhr prayer while the Fajr prayer was missed by you, and then you remembered it, you should pray it at whatever time you remember it, even if it is after the 'Asr prayer. And whenever you remember a prayer that was missed by you, you should pray it.
And he said: If you forgot the Dhuhr prayer until you prayed the 'Asr prayer, and then you remembered it while you were in the 'Asr prayer or had finished the 'Asr prayer, you should intend it as the Dhuhr prayer (change your intention to the Dhuhr prayer) and then pray the 'Asr prayer, because it is four rak'ahs which are in place of those four rak'ahs.
So if you remembered that you had not prayed the Dhuhr prayer and you were in the 'Asr prayer and had prayed two rak'ahs of it, you should intend it as the Dhuhr prayer and then pray the remaining two rak'ahs and then stand up and pray the 'Asr prayer.
And if you remembered that you had not prayed the 'Asr prayer until the time for the Maghrib prayer had entered and you do not fear missing the time for the Maghrib prayer, then pray the 'Asr prayer and after that pray the Maghrib prayer. And if you had prayed the Maghrib prayer, stand up and pray the 'Asr prayer. And if you had prayed two rak'ahs of the Maghrib prayer and then remembered the 'Asr prayer, you should intend it as the 'Asr prayer and then stand up and complete it with two rak'ahs and then say the salutation, and then pray the Maghrib prayer.
And if you prayed the 'Isha prayer and forgot the Maghrib prayer, then stand up and pray the Maghrib prayer. And if you were in the middle of the 'Isha prayer, having prayed two rak'ahs of it or having stood up for the third rak'ah, and you remembered that you had not prayed the Maghrib prayer, you should intend it as the Maghrib prayer and then say the salutation, and then stand up and pray the 'Isha prayer.
And if you forgot the 'Isha prayer until you prayed the Fajr prayer, then pray the 'Isha prayer. And if you were in the first or second rak'ah of the Fajr prayer, you should intend it as the 'Isha prayer and then stand up and pray the Fajr prayer and say the adhan and iqama for it...
2 عَنْ عَبْدِ الرَّحْمَنِ بْنِ أَبِي عَبْدِ اللَّهِ قَالَ: سَأَلْتُ أَبَا عَبْدِ اللَّهِ عَنْ رَجُلٍ نَسِيَ صَلَاةً حَتَّى دَخَلَ وَقْتُ صَلَاةٍ أُخْرَى فَقَالَ إِذَا نَسِيَ الصَّلَاةَ أَوْ نَامَ عَنْهَا صَلَّى حِينَ يَذْكُرُهَا فَإِذَا ذَكَرَهَا وَ هُوَ فِي صَلَاةٍ بَدَأَ بِالَّتِي نَسِيَ وَ إِنْ ذَكَرَهَا مَعَ إِمَامٍ فِي صَلَاةِ الْمَغْرِبِ أَتَمَّهَا بِرَكْعَةٍ ثُمَّ صَلَّى الْمَغْرِبَ ثُمَّ صَلَّى الْعَتَمَةَ بَعْدَهَا وَ إِنْ كَانَ صَلَّى الْعَتَمَةَ وَحْدَهُ فَصَلَّى مِنْهَا رَكْعَتَيْنِ ثُمَّ ذَكَرَ أَنَّهُ نَسِيَ الْمَغْرِبَ أَتَمَّهَا بِرَكْعَةٍ فَتَكُونُ صَلَاتُهُ لِلْمَغْرِبِ ثَلَاثَ رَكَعَاتٍ ثُمَّ يُصَلِّي الْعَتَمَةَ بَعْدَ ذَلِكَ.
📚 Al-Kafi, vol. 3, p. 293
Abd al-Rahman ibn Abi Abdullah says: I asked Imam al-Sadiq (peace of God be upon him) about a person who forgets a prayer until the time of another prayer comes. The Imam said: When he forgets a prayer or falls asleep and misses it, he prays it whenever he remembers it. So when he remembers it while he is in prayer, he should begin with what he forgot. And if he remembers it with the prayer leader in the Maghrib prayer, he should complete it with one rak'ah (to make it four rak'ahs) and then pray the Maghrib and then the 'Isha after it.
And if he prays the 'Isha prayer alone and prays two rak'ahs of it and then remembers that he forgot the Maghrib prayer, he should complete it with one rak'ah to make it three rak'ahs of the Maghrib prayer and then pray the 'Isha prayer after it.
3 عَنِ الْحَلَبِيِّ قَالَ: سَأَلْتُهُ عَنْ رَجُلٍ نَسِيَ أَنْ يُصَلِّيَ الْأُولَى حَتَّى صَلَّى الْعَصْرَ قَالَ فَلْيَجْعَلْ صَلَاتَهُ الَّتِي صَلَّى الْأُولَى ثُمَّ لْيَسْتَأْنِفِ الْعَصْرَ الْحَدِيثَ.
📚 Al-Tahdhib, vol. 2, p. 269
Halabi says: I asked (Imam al-Sadiq, peace of God be upon him) about a person who forgets the Dhuhr prayer until he prays the 'Asr prayer. He said: He should consider the prayer he prayed as the Dhuhr prayer and then begin the 'Asr prayer from the beginning!
4 عَنْ عُبَيْدِ بْنِ زُرَارَةَ عَنْ أَبِي عَبْدِ اللَّهِ قَالَ: إِذَا غَرَبَتِ الشَّمْسُ فَقَدْ دَخَلَ وَقْتُ الصَّلَاتَيْنِ إِلَى نِصْفِ اللَّيْلِ إِلَّا أَنَّ هَذِهِ قَبْلَ هَذِهِ وَ إِذَا زَالَتِ الشَّمْسُ فَقَدْ دَخَلَ وَقْتُ الصَّلَاتَيْنِ إِلَّا أَنَّ هَذِهِ قَبْلَ هَذِهِ.
📚 Al-Tahdhib, vol. 2, p. 27
Imam al-Sadiq (peace of God be upon him) said: When the sun sets, the time for the two prayers (Maghrib and 'Isha) has entered until midnight, except that this (i.e., the Maghrib prayer) is before this (i.e., the 'Isha prayer). And when the sun passes its zenith, the time for the two prayers, Dhuhr and 'Asr, has entered, except that this (i.e., the Dhuhr prayer) is before this (i.e., the 'Asr prayer)!
✅It is clear from the above narrations and others that a person is obligated to first pray the Maghrib prayer and then the 'Isha prayer, and to first pray the Dhuhr prayer and then the 'Asr prayer.
However, if a person forgets to pray the Maghrib prayer and prays the 'Isha prayer, if he has prayed two rak'ahs of the 'Isha prayer or has stood up for the third rak'ah and remembers that he forgot the Maghrib prayer, he should intend it as the Maghrib prayer and then pray the 'Isha prayer.
But if he remembers that he forgot the Maghrib prayer after the 'Isha prayer, he should pray the Maghrib prayer.
Similarly, if he is in the middle of the 'Asr prayer and remembers that he forgot to pray the Dhuhr prayer, he should change his intention to the Dhuhr prayer and after that pray the 'Asr prayer. And if he remembers that he forgot to pray the Dhuhr prayer after the 'Asr prayer, he should consider the prayer he prayed as the Dhuhr prayer and begin the 'Asr prayer from the beginning.
The other categories of this matter are also made clear by a careful study of the above narrations.