Mishkat al-Masabih
Mishkat al-Masabih 1144
The manner in which one who is led in prayer by an Imam must follow him, and the rule applying to the one who is preceded by him - Section 2
Arabic hadith text
وَعَنْ أَنَسٍ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ:" مَنْ صَلَّى لِلَّهِ أَرْبَعِينَ يَوْمًا فِي جَمَاعَةٍ يُدْرِكُ التَّكْبِيرَةَ الْأُولَى كُتِبَ لَهُ بَرَاءَتَانِ: بَرَاءَةٌ مِنَ النَّارِ وَبَرَاءَةٌ مِنَ النِّفَاق ". رَوَاهُ التِّرْمِذِيّ
Translation
Anas reported God’s Messenger as saying, “If anyone prays to God for forty days in congregation being present in time for the first takbira, two immunities will be recorded for him, one from hell and one from hypocrisy,” Tirmidhi transmitted it.