The holy month of Ramadan consistently brings forth magnificent night worship. One of the most prominent acts is Qiyam al-Lail, which is widely recognized as the Tarawih prayer. In Islamic jurisprudence, particularly within the Shafi’i school of thought, the rules governing this worship are comprehensively detailed. The primary goal is to preserve the quality of a servant’s deeds from the spiritual disease of ostentation (riya’) and to guide them toward genuine sincerity (ikhlas).
This article academically examines the legal ruling, the historical background, the number of rak’ahs in Tarawih prayer, and the jurisprudential debates regarding its virtues. The primary reference for this discussion is the original text from the classical book Asna al-Matalib, authored by the great scholar Shaykh al-Islam Zakariyya al-Ansari. For those who wish to understand the complete foundational framework of voluntary worship before delving into Tarawih, please study the complete guide to voluntary sunnah prayers that we have meticulously compiled.
History and the Number of Rak’ahs in Tarawih Prayer (20 Rak’ahs)
According to the prevailing view of the majority of scholars in the Shafi’i school, the Tarawih prayer is performed as twenty rak’ahs. The text of Asna al-Matalib firmly states this ruling:
قوله: (وهي عشرون ركعة) بعشر تسليمات في كل ليلة من رمضان، والأصل فيها خبر الصحيحين عن عائشة أنه – صلى الله عليه وسلم – «صلاها ليالي فصلوها معه، ثم تأخر وصلى في بيته باقي الشهر وقال خشيت أن تفرض عليكم فتعجزوا عنها»
Meaning: (And it is twenty rak’ahs) with ten salutations (salam) every night in Ramadan. The foundational evidence is the narration from the Sahihayn by Aisha (may Allah be pleased with her) that the Prophet (ﷺ) performed this prayer (in the mosque) for a few nights, and the companions prayed with him. Then he held back (did not go to the mosque) and prayed in his house for the rest of the month. He said: “I feared that this prayer would be made obligatory upon you, and you would be unable to perform it.”
The history of performing it in a full congregation for an entire month began with the noble initiative of Caliph Umar ibn al-Khattab. Shaykh al-Islam Zakariyya al-Ansari continues his explanation:
ولأن عمر جمع الناس على قيام شهر رمضان الرجال على أبي بن كعب، والنساء على سليمان بن أبي حثمة رواه البيهقي وروى أيضا هو وغيره بإسناد صحيح أنهم كانوا يقومون على عهد عمر بن الخطاب – رضي الله عنه – في شهر رمضان بعشرين ركعة
Meaning: And because Umar gathered the people to perform the night prayer of Ramadan; the men were led by Ubayy ibn Ka’ab, and the women were led by Sulayman ibn Abi Hathmah (Narrated by Al-Bayhaqi). He and other scholars also narrated with an authentic chain that the companions used to stand for prayer during the time of Umar ibn al-Khattab (may Allah be pleased with him) in the month of Ramadan for twenty rak’ahs.
From the exposition of the evidence above, it is profoundly clear that twenty rak’ahs is the practical consensus (ijma’) executed by the companions, serving as the primary benchmark in the Shafi’i school.

In practice, the nights of Ramadan serve as the optimal momentum to cleanse one’s inner spiritual state (hal) from sins to reach a noble spiritual station (maqam). Therefore, this night worship is highly appropriate when accompanied by a deep understanding of the Taubat Nasuha prayer along with its evidence, procedures, and supplication, ensuring the soul returns to a state of purity while seeking the pleasure of Allah the Exalted.
Why Did the People of Madinah Pray 36 Rak’ahs?
Although the primary foundation is 20 rak’ahs, historical records indicate that the people of Madinah in the past performed the Tarawih prayer with 36 rak’ahs. The book Asna al-Matalib presents the historical reasoning behind this technical difference:
ولأهل المدينة فعلها ستا وثلاثين؛ لأن العشرين خمس ترويحات فكان أهل مكة يطوفون بين كل ترويحتين سبعة أشواط فجعل أهل المدينة بدل كل أسبوع ترويحة؛ ليساووهم. قال الشيخان: ولا يجوز ذلك لغيرهم؛ لأن لأهلها شرفا بهجرته – صلى الله عليه وسلم – ومدفنه
Meaning: And for the people of Madinah, they performed it as thirty-six rak’ahs. The reason is that twenty rak’ahs consist of five tarwiha (rest periods). The people of Makkah used to perform Tawaf for seven circuits between every two tarwiha. Thus, the people of Madinah replaced every seven circuits of Tawaf with one tarwiha (four rak’ahs) so they could equal the virtues of the people of Makkah. The two Shaykhs (Al-Rafi’i and Al-Nawawi) said: This is not permissible for anyone other than the people of Madinah, because the people of Madinah possess the honor of the Prophet’s (ﷺ) migration and his burial place.

Etymologically, the term Tarawih originates from the word Tarwiha, which means rest. The people of Makkah utilized their rest periods (the break after every four rak’ahs) by performing the Tawaf ritual around the Kaaba. Because the people of Madinah did not have the Kaaba, they substituted the reward of Tawaf with an additional four rak’ahs of prayer during each break, bringing the total to an even 36 rak’ahs. However, this addition was exclusive to the inhabitants of Madinah during that era and does not apply to Muslims in other regions.
Condition of Validity: Salam After Every Two Rak’ahs
A highly strict fiqh rule in the Shafi’i school regarding the execution of the Tarawih prayer is the absolute necessity of performing a salam after every two rak’ahs.
ينوي بإحرام كل ركعتين التراويح، أو قيام رمضان … فلو صلى أربعا بتسليمة لم يصح
Meaning: He intends the Tarawih prayer or Qiyam of Ramadan at every opening takbir for two rak’ahs… Thus, if he prays four rak’ahs with a single salam, his prayer is invalid.
This is mandated because the Tarawih prayer closely resembles obligatory prayers in its strong recommendation for congregation. Therefore, its rules cannot be altered from the established traditional narrations (ma’tsur). If a person violates this procedure and prays four rak’ahs consecutively with one salam, their worship is deemed legally invalid.
This stringent rule differs slightly from certain daytime voluntary prayers which offer more technical flexibility, as you can find in the guide to Dhuha prayer regarding its more adaptable rak’ah variations.
Fiqh Debate: Tarawih vs. Rawatib Prayers
Within the hierarchy of Shafi’i fiqh, there is a dynamic scholarly discourse regarding the virtuous standing of the Tarawih prayer when compared to the Sunnah Rawatib prayers that accompany the obligatory prayers. The original text outlines this academic debate:
قوله: (ثم التراويح وغير الضحى من الرواتب أفضل من التراويح) ، وإن سن لها الجماعة؛ لأنه – صلى الله عليه وسلم – واظب على الرواتب دون التراويح قال الزركشي، وهذا تبع فيه الرافعي الإمام، وهو خلاف مذهب الشافعي. وجمهور الأصحاب أن التراويح أفضل من الرواتب ما عدا ركعتي الفجر، والوتر
Meaning: (Then the Tarawih. And the Rawatib—other than the two rak’ahs before Fajr and the Witr—are better than Tarawih), even though Tarawih is recommended in congregation. The reason is that the Prophet (ﷺ) consistently maintained the Rawatib and did not consistently maintain Tarawih (in the mosque fully). Imam al-Zarkashi said: In this view, Al-Rafi’i followed Imam al-Haramayn, and this contradicts the primary foundation of the Shafi’i school. The majority of the associates (Shafi’i scholars) hold that the Tarawih prayer is superior to the Rawatib prayers, except for the two rak’ahs of Fajr and the Witr prayer.
In conclusion, although Imam al-Haramayn and Al-Rafi’i considered Rawatib more magnificent because they were consistently maintained by the Prophet (ﷺ), the majority (jumhur) of Shafi’i scholars established that Tarawih is superior to standard Rawatib prayers. The congregational nature of Tarawih automatically elevates its status above voluntary worship performed individually. A more detailed explanation of the ranking of these voluntary acts can be read in the article discussing the hierarchy of sunnah prayers’ virtues.
The Etiquette of Reciting the Qur’an in Tarawih
To maintain deep reverence (khushu’) and prevent spiritual lethargy (futur), Shafi’i scholars highly recommend reciting the Qur’an sequentially (tartil) until its completion over the full month of Tarawih.
قوله: (و) فعلها (بالقرآن) في جميع الشهر (أفضل من تكرير سورة الإخلاص) في كل ركعة مثلا قال ابن الصلاح؛ لأنه أشبه بالسنة
Meaning: (And) performing it (by reciting the entire Qur’an) throughout the month (is better than repeating Surah Al-Ikhlas) in every rak’ah, for example. Ibn al-Salah said: Because that more closely resembles the Sunnah.
However, it is considered disliked (makruh) if an imam deliberately burdens himself or the congregation by reciting a specific long surah entirely in a single final rak’ah merely due to personal sentiment. Scholars advise that the imam must always consider the etiquette of gentleness toward the congregation.
The month of Ramadan is also a profound medium for answered prayers. If, amidst the nights of Ramadan, a servant has a pressing need to seek a way out of a complex problem, they can practice the supplications according to the instructions in the complete guide to Hajat prayer. Similarly, if one is plagued by uncertainty in making a critical decision, reciting the dua for Istikharah prayer during the last third of Ramadan nights is a highly recommended sunnah practice.
Comparison Table of Salaf Tarawih Practices
Below is a brief comparison of the qiyam practices of Ramadan during the era of the pious predecessors (salaf) based on the manuscript of Asna al-Matalib:
| Aspect of Practice | Makkah / Majority of Regions | Madinah (Specifically in the Past) |
| Number of Rak’ahs | 20 Rak’ahs | 36 Rak’ahs |
| Number of Salams | 10 salams | 18 salams |
| Activity During Break (Tarwiha) | Performing Tawaf for 7 circuits | Performing an additional 4 rak’ahs |
| Current Legal Status | Applicable to all Muslims | An exclusive practice of the past people of Madinah |
FAQ (Frequently Asked Questions on Tarawih Rules)
Is it permissible to perform 4 rak’ahs of Tarawih prayer with only 1 salam?
Based on the book Asna al-Matalib and the majority of Shafi’i scholars, this is legally invalid. A person must intend the Tarawih prayer at every takbiratul ihram for two rak’ahs, and it is mandatory to perform a salam after every multiple of those two rak’ahs.
Who was the first to gather the Tarawih congregation for a full month in the mosque?
It was Caliph Umar ibn al-Khattab (may Allah be pleased with him). He appointed the companion Ubayy ibn Ka’ab as the imam for the male congregation and Sulayman ibn Abi Hathmah as the imam for the female congregation.
Which is more virtuous, the Tarawih prayer or the Qabliyah Fajr (Sunnah before Dawn) prayer?
The majority (jumhur) of Shafi’i scholars determine that the two rak’ahs of Fajr (Qabliyah Subuh) and the Witr prayer hold a higher, more virtuous position than the Tarawih prayer, even though Tarawih is superior compared to the majority of other Rawatib prayers.
Conclusion
The establishment of the Tarawih prayer in the month of Ramadan is a tangible manifestation of the Muslims’ love in emulating the sunnah of the Messenger of Allah (ﷺ) and the Rightly Guided Caliphs. By adhering to the mu’tamad (strong) opinion of the Shafi’i school—as academically recorded in the book Asna al-Matalib—the number of rak’ahs in Tarawih prayer being twenty is a Shari’ah standard with a preserved historical chain. Knowing the rulings, procedures, and the hierarchy of its virtues will protect us from confusion and strengthen the foundation of sincerity (ikhlas) in every prostration during those noble nights. Wallahu a’lam bish-shawab (And Allah knows best).
Conceptual References & Bibliography
Zakariyā al-Anṣārī, Asnā al-Maṭālib fī Sharḥ Rawḍ al-Ṭālib, with annotations by Aḥmad al-Ramlī, edited by Muḥammad az-Zuhrī al-Ghamrāwī (Cairo: al-Maṭbaʿah al-Maymānīyah, 1313 AH; repr. Dār al-Kitāb al-Islāmī), vol. 1, pp. 200–201.
