Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) narrates: The Prophet (peace and blessings be upon him) said: "Whoever forgets a prayer and then remembers it while he is with the imam (offering another prayer) should complete his prayer, then make up the prayer that he forgot, and then repeat the prayer that he offered with the imam."
Al-Tabarani recorded it in al-Awsat; its narrators are thiqat (trustworthy), except that al-Tabarani's shaykh, Muhammad bin Hisham al-Mustamli, is a different matter: I have not found anyone who mentions him.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 1818
Hadith Gradingمحدثین:إسنادہ ضعیف
Hadith Takhrij«المعجم الاوسط للطبراني باب العين باب الميم من اسمه محمد . حديثة 5235 ، أخرجه المعجم الأوسط للطبراني برقم: 5128»