The holy month of Ramadan brings a remarkably majestic symbol of night worship, primarily Qiyam al-Lail, which is specifically known as Tarawih prayers. In the jurisprudential literature (fiqh) of the Shafi’i school, the regulations governing this worship are discussed profoundly to protect the quality of a servant’s deeds from the spiritual disease of showing off (Riyā’) and to guide them towards genuine sincerity (Ikhlāṣ).
This article academically examines the legal ruling, history, number of rakaats (units of prayer), and the jurisprudential debates regarding the virtues of Tarawih prayers, based directly on the original texts from the book Asna al-Matalib authored by Shaykh al-Islam Zakariyya al-Ansari. For those who wish to delve into the foundational framework of voluntary (tathawwu’) worship comprehensively before discussing Tarawih, please study the complete fiqh guide to voluntary prayers that we have previously compiled.
The History and Evidence for 20 Rakaats of Tarawih Prayers
According to the view of the majority of scholars in the Shafi’i school, Tarawih prayers are performed as twenty rakaats. The text of Asna al-Matalib explicitly states this regulation:
قوله: (وهي عشرون ركعة) بعشر تسليمات في كل ليلة من رمضان، والأصل فيها خبر الصحيحين عن عائشة أنه – صلى الله عليه وسلم – «صلاها ليالي فصلوها معه، ثم تأخر وصلى في بيته باقي الشهر وقال خشيت أن تفرض عليكم فتعجزوا عنها»
Translation: “(It consists of twenty rakaats) with ten salutations (salam) on every night of Ramadan. The primary evidence for it is the narration in the two Sahihs (Bukhari and Muslim) from Aisha (may Allah be pleased with her) that the Prophet ﷺ performed that prayer (in the mosque) for a few nights, and the companions prayed along with him. Then he held back (from going to the mosque) and prayed in his house for the remainder of the month. He said: ‘I feared that it would be made obligatory upon you, and you would be unable to perform it.'”
The history of its continuous congregational performance for a full month originated from the initiative of Sayyidina Umar bin Khattab (may Allah be pleased with him). Shaykh al-Islam Zakariyya al-Ansari continues his explanation:
ولأن عمر جمع الناس على قيام شهر رمضان الرجال على أبي بن كعب، والنساء على سليمان بن أبي حثمة رواه البيهقي وروى أيضا هو وغيره بإسناد صحيح أنهم كانوا يقومون على عهد عمر بن الخطاب – رضي الله عنه – في شهر رمضان بعشرين ركعة
Translation: “And because Umar gathered the people for the qiyam of the month of Ramadan; the men followed Ubay bin Ka’ab as the Imam, and the women followed Sulaiman bin Abi Hatsmah. (Narrated by Al-Bayhaqi). He and other scholars also narrated with an authentic chain (isnad sahih) that the companions used to perform the qiyam during the era of Umar bin Khattab in the month of Ramadan with twenty rakaats.”

From the evidence above, it is profoundly clear that twenty rakaats is the standard established and practiced by the companions, and it has become the primary guideline within the Shafi’i school.
The silence of the Ramadan nights after Tarawih is the optimum moment for intimate converse with Allah (munajat), seeking forgiveness, and offering supplications with deep sincerity (khusyu’). In practice, the nights of Ramadan also serve as the best momentum to cleanse one’s inner spiritual state (Ḥāl) from sins and attain a noble spiritual station (Maqām). Therefore, this night worship is highly appropriate when accompanied by the practice of the prayer of sincere repentance (Taubat Nasuha) and its supplication, so that the soul returns pure while seeking the pleasure of Allah the Almighty.
Why Did the People of Madinah Perform 36 Rakaats of Tarawih?
Although the primary foundation is 20 rakaats, history records that the people of Madinah in the past performed Tarawih prayers totaling 36 rakaats. Asna al-Matalib exposes the historical reasoning behind this variance:
ولأهل المدينة فعلها ستا وثلاثين؛ لأن العشرين خمس ترويحات فكان أهل مكة يطوفون بين كل ترويحتين سبعة أشواط فجعل أهل المدينة بدل كل أسبوع ترويحة؛ ليساووهم. قال الشيخان: ولا يجوز ذلك لغيرهم؛ لأن لأهلها شرفا بهجرته – صلى الله عليه وسلم – ومدفنه
Translation: “And for the people of Madinah, they performed it as thirty-six rakaats. The reason is that twenty rakaats consist of five tarwiha (rest periods). The people of Makkah used to perform Tawaf (circumambulation of the Kaaba) for seven circuits between every two tarwihas. Therefore, the people of Madinah established one tarwiha (four rakaats) as a substitute for every usbu’ (seven circuits of Tawaf) so they could equal the virtue of the people of Makkah. The two Shaykhs (Ar-Rafi’i and An-Nawawi) said: That is not permissible for anyone other than the people of Madinah, because its people possess a specific honor due to the migration (hijrah) of the Prophet ﷺ to it and his burial place there.”

Historically, the people of Makkah filled the rest periods (tarwiha) between the rakaats of Tarawih by performing Tawaf around the Kaaba. The term “Tarawih” itself originates from the word Tarwiha, which means to rest. Because the people of Madinah did not have the Kaaba, they substituted that Tawaf with an additional four rakaats of prayer during each break, bringing the total to 36 rakaats. However, this addition of rakaats was strictly exclusive to the people of Madinah at that time and does not apply to Muslims in other regions.
Condition of Validity: Must Conclude Every Two Rakaats with Salam
A highly strict fiqh rule in the Shafi’i school regarding Tarawih prayers is the absolute necessity to end the prayer with salam after every two rakaats.
ينوي بإحرام كل ركعتين التراويح، أو قيام رمضان … فلو صلى أربعا بتسليمة لم يصح
Translation: “He must intend the Tarawih prayer or Qiyam of Ramadan with every opening takbir (takbiratul ihram) for two rakaats… Thus, if he were to pray four rakaats with a single salam, it would be invalid.”
This is because Tarawih prayers closely resemble obligatory (fardh) prayers in the strong recommendation to perform them in congregation; hence, its structure cannot be altered from the established historical narrations (which dictate a salam every two rakaats). If a person violates this procedure and performs four rakaats consecutively with one salam, their worship is legally invalid.
This strict rule differs slightly from some daytime voluntary prayers which offer more technical leniency, as detailed in the guide to Dhuha prayer regarding the variations in performing its rakaats.
Fiqh Debate: Tarawih vs. Rawatib Prayers, Which is Superior?
Within the fiqh hierarchy of the Shafi’i school, there is a divergence of scholarly opinion regarding the degree of virtue of Tarawih prayers compared to the Rawatib sunnah prayers (the prayers accompanying the obligatory prayers).
The original text presents this debate:
قوله: (ثم التراويح وغير الضحى من الرواتب أفضل من التراويح) ، وإن سن لها الجماعة؛ لأنه – صلى الله عليه وسلم – واظب على الرواتب دون التراويح قال الزركشي، وهذا تبع فيه الرافعي الإمام، وهو خلاف مذهب الشافعي. وجمهور الأصحاب أن التراويح أفضل من الرواتب ما عدا ركعتي الفجر، والوتر
Translation: “(Then the Tarawih prayer. And the Rawatib prayers—other than the two rakaats before Subuh and the Witr—are more virtuous than Tarawih), even though it is recommended to perform Tarawih in congregation. The reasoning is that the Prophet ﷺ consistently performed the Rawatib but did not consistently perform Tarawih (in the mosque fully). Imam Zarkasyi said: In this opinion, Ar-Rafi’i followed Imam al-Haramain, and this contradicts the primary foundation of the Shafi’i school. The majority (jumhur) of the companions (Shafi’i scholars) hold the opinion that Tarawih is more virtuous than the Rawatib, except for the two rakaats of Fajr (before Subuh) and the Witr prayer.”
Thus, although Imam al-Haramain and Ar-Rafi’i evaluated Rawatib as more majestic because they were continuously practiced by the Prophet ﷺ, the majority (jumhur) of Shafi’i scholars determined that Tarawih holds a higher status than regular Rawatib prayers. The Shari’ah recommendation for a congregation in Tarawih elevates its rank above voluntary acts of worship performed individually. A more detailed explanation regarding the hierarchical sequence of virtues for various sunnah deeds can be read in the article on the order of priority of sunnah prayers.
Etiquette of Reciting the Qur’an in Tarawih
To maintain reverence (khusyu’) and distance oneself from the feeling of Futur (laziness in worship), Shafi’i scholars highly recommend reciting the Qur’an sequentially until its completion (khatam) throughout the month of Tarawih.
قوله: (و) فعلها (بالقرآن) في جميع الشهر (أفضل من تكرير سورة الإخلاص) في كل ركعة مثلا قال ابن الصلاح؛ لأنه أشبه بالسنة
Translation: “(And) performing it (by reciting the entire Qur’an) throughout the month (is more virtuous than repeatedly reciting Surah Al-Ikhlas) in every rakaat, for example. Ibn As-Salah said: Because that is closer to the sunnah.”
It is considered disliked (makruh) if a person intentionally burdens themselves or their congregation by reciting a specifically long chapter (such as Surah Al-An’am) entirely in one final rakaat simply due to a specific belief (for instance, the belief that the chapter was revealed all at once). Scholars like Ibn As-Salah and An-Nawawi viewed this as an act that contradicts the etiquette of gentleness in worship.
Ramadan is also the month where prayers are answered. If, during the nights of Ramadan, a servant intends to seek an expansion in sustenance or a way out of complex problems, they can perform it according to the instructions in the complete guide to the prayer of need (Sholat Hajat). Likewise, if one is struck by uncertainty when making a major life decision, chanting the supplication of the Istikharah prayer during the last third of the Ramadan night is a highly recommended practice.
Comparative Table of Early Generations’ (Salaf) Tarawih Practices
Below is a comparison of the Qiyam Ramadan practices during the era of the salaf based on the manuscript of Asna al-Matalib:
| Aspect of Practice | Makkah / Majority of Regions | Madinah (Specifically in the Past) |
| Number of Rakaats | 20 Rakaats | 36 Rakaats |
| Number of Salams | 10 times salam | 18 times salam |
| Activity During Break (Tarwiha) | Performing Tawaf for 7 circuits | Performing an additional 4 rakaats |
| Current Legal Status | Applicable to all Muslims globally | Was an exclusivity for the people of Madinah |
FAQ (Questions and Answers Regarding Tarawih Prayer Rules)
Is it permissible to perform 4 rakaats of Tarawih prayer with only 1 salam?
Based on the book Asna al-Matalib, the ruling is invalid (tidak sah). A person must intend the Tarawih prayer at the beginning (takbiratul ihram) for every two rakaats, and it is obligatory to conclude with a salam at every multiple of those two rakaats.
Who was the first to gather the Tarawih congregation for a full month?
Sayyidina Umar bin Khattab (may Allah be pleased with him). He appointed Ubay bin Ka’ab as the Imam for the male congregation and Sulaiman bin Abi Hatsmah as the Imam for the female congregation.
Which is more virtuous, the Tarawih prayer or the Qabliyah Subuh (two rakaats before Dawn) sunnah prayer?
The majority (jumhur) of Shafi’i scholars established that the two rakaats of Fajr (Qabliyah Subuh) and the Witr prayer hold a more virtuous position than the Tarawih prayer, even though Tarawih is superior to the majority of other Rawatib prayers.
Conclusion
The establishment of Tarawih prayers 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 strong opinion of the Shafi’i school—as recorded in Asna al-Matalib—twenty rakaats stands as the academic and Shari’ah standard whose historical chain is meticulously preserved.
Knowing its ruling, procedures, and hierarchy of virtues will prevent us from confusion and strengthen the foundation of sincerity (Ikhlāṣ) in every prostration during those majestic nights. Wallahu a’lam bish-shawab (And Allah knows best).
Reference
Zakariyā al-Anṣārī, Asnā al-Maṭālib fī Sharḥ Rawḍ al-Ṭālib, with the ḥāshiyah by Aḥmad al-Ramlī, edited by Muḥammad az-Zuhrī al-Ghamrāwī (Cairo: al-Maṭbaʿah al-Maymānīyah, 1313 H; repr. Dār al-Kitāb al-Islāmī), vol. 1, pp. 200-201.
