What is the ruling if someone stands up for an extra unit in a prayer (e.g., the fifth rak'ah in a four-rak'ah prayer)?

Chapter on the Two Prostrations of Forgetfulness

Al-Mughni

Book of Prayer

Book 3 · Issue 1 · Bab 7

Open in Qurani

Primary text

If one stands for the fifth unit in a four-rak'ah prayer, the fourth in Maghrib, or the third in Fajr, one must immediately return and sit upon remembering. If one has recited the Tashahhud after the completion of the prayer's required units, one should perform the prostrations of forgetfulness (Sujud as-Sahw) and then give the final salutation (Tasleem). If one had recited the Tashahhud but omitted the blessing upon the Prophet, one should recite the blessing, then perform Sujud as-Sahw, and then give the salutation. If one had not recited any Tashahhud, one must recite the Tashahhud, then perform Sujud as-Sahw, and then give the salutation. This ruling is held by Alqamah, Al-Hasan, 'Ata', Az-Zuhri, An-Nakha'i, Malik, Al-Layth, Ash-Shafi'i, Ishaq, and Abu Thawr. The evidence is based on the narration of 'Abdullah ibn Mas'ud where the Prophet (peace be upon him) prayed five units, and upon realizing it, he performed two prostrations of forgetfulness and then gave the salutation, stating he was only a human who forgets, and instructed that if one forgets, they should prostrate twice.

Supporting text

Abu Hanifah holds that if remembrance occurs before prostration, one sits for the Tashahhud. If remembrance occurs after prostration, and one had sat for the duration of the Tashahhud after the fourth unit, the prayer is valid, and the extra unit becomes an optional supererogatory act (Nafl) by adding another unit to make it even. If one did not sit for the Tashahhud in the fourth unit, the obligatory prayer is nullified, it becomes Nafl, and one must repeat the prayer. Hammad ibn Abi Sulayman shares a similar view. Qatadah and Al-Awza'i rule that if one prays four units in Maghrib, one adds another unit to make the two units voluntary, citing the Hadith of Abu Sa'id where the Prophet (peace be upon him) said regarding one who prostrates twice: 'If his prayer was complete, the rak'ah and the two prostrations are voluntary,' and in another narration: 'If he prayed five, it made his prayer even.'