What is the ruling when someone who prematurely ended their prayer starts a subsequent prayer before remembering the missed portion?

Chapter on the Two Prostrations of Forgetfulness

Al-Mughni

Book of Prayer

Book 3 · Issue 4 · Bab 7

Open in Qurani

Primary text

If a person does not recall the omission until they commence a second prayer, the ruling depends on the duration of the first segment completed in the second prayer. If what was performed in the second prayer is minimal and the separation was not long, the person should return to the first prayer and complete it. If the separation was prolonged, the first prayer is invalidated. This is the view held by ash-Shafi'i.

Supporting text

Abu al-Faraj al-Mubhij stated that the portion performed in the second prayer is deemed completion for the first, treating the initial salutation as non-existent due to the excusable forgetfulness. Al-Hasan and Hammad ibn Abi Sulayman hold that if the person proceeds to a voluntary prayer, the obligatory prayer is nullified. Malik and Ahmad suggest that it is better to restart the obligatory prayer entirely, viewing the subsequent action as akin to speech that breaks the initial prayer.