Short answer
Join the imam in whatever position he is in. You count a rakah if you reach ruku before he rises from it. After the imam's final salam, stand up without saying salam and complete what you missed. In the Hanafi school the rakats you make up are treated as the start of your prayer for recitation and the end for sitting.
A latecomer (masbuq) says the opening takbir standing and joins the imam in his current position. A rakah is caught by catching the ruku. After the imam's salam he completes the missed rakats, reciting al-Fatihah and a surah in them as if they were his first rakats, while counting his sittings from the rakats he has actually prayed.
Other madhhabs
- Shafi'i
- What you pray with the imam is the start of your prayer and what you make up is its end, so in the made-up rakats you recite as in the later rakats.
Explanation
The Prophet ﷺ said: whatever you catch, pray it, and whatever you miss, complete it. So never wait for the next rakah. Say "Allahu akbar" standing, then join the imam in ruku, sajdah or sitting, and follow him. If you reach ruku before the imam rises, that rakah counts. If you join in sajdah or sitting, the reward of joining is yours, but that rakah does not count.
In the last tashahhud with the imam: recite only the tashahhud, slowly, and do not give salam. When the imam finishes both salams, stand up with "Allahu akbar" and complete your prayer.
How to complete (Hanafi):
- Missed 1 rakah: pray it with al-Fatihah and a surah, then the final sitting.
- Missed 2 of Maghrib: first one with al-Fatihah and surah, then sit for tashahhud (it is your second rakah); second one with al-Fatihah and surah, then the final sitting.
- Missed 3 of a 4 rakat prayer: first with al-Fatihah and surah, then sit (your second); second with al-Fatihah and surah, no sitting; third with al-Fatihah only, then the final sitting.
- Missed all 4: pray it like a normal four rakat prayer.
If the imam does sajdah al-sahw, do it with him, then stand and complete. Walk to the prayer calmly; running is discouraged even if you might miss the ruku. See is congregation obligatory and the guide to how to pray.
The evidence
Quran, Surah Al-Baqara 2:43
وَأَقِيمُوا۟ ٱلصَّلَوٰةَ وَءَاتُوا۟ ٱلزَّكَوٰةَ وَٱرْكَعُوا۟ مَعَ ٱلرَّٰكِعِينَ ﴿٤٣﴾
And establish prayer and give zakah and bow with those who bow [in worship and obedience].
Joining the congregation, even late, is part of this command.
Sahih al-Bukhari 635
Sahih... فما أدركتم فصلوا وما فاتكم فأتموا ...
"Whatever you catch, pray it, and whatever you miss, complete it."
The latecomer joins at once and completes what he missed.
Sahih al-Bukhari 783
Sahih... زادك الله حرصا ولا تعد ...
"May Allah increase your eagerness, but do not do it again."
Said to Abu Bakrah, who rushed to catch the ruku; it shows the ruku is caught and that rushing is discouraged.
Where the ruling is recorded
- al-Durr al-Mukhtar with Radd al-Muhtar, Chapter on the imamate, the rulings of the masbuq. The masbuq completes the start of his prayer in recitation and the end in tashahhud.
- Nur al-Idah with Maraqi al-Falah, Chapter on the masbuq. Whoever catches the imam in ruku has caught the rakah.
- Minhaj al-Talibin, Chapter on following the imam. The Shafi'i view that what is caught with the imam is the start of the prayer.
This answer is pending review by the scholars on our team. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.