Fiqh Rulings and Issues in Light of the Quran and Hadith, Rulings and Issues of Prayer: Volume 01: Page 250
Question
السلام عليكم ورحمة الله وبركاته
Answer with the Help of Al-Wahhab, Assuming the Question is Correct
وعلیکم السلام ورحمة الله وبرکاته!
الحمد لله، والصلاة والسلام علىٰ رسول الله، أما بعد!
Praise be to Allah, who has bestowed upon us a Sharia that encompasses all the benefits of human life and the afterlife. Among these are the rulings regarding funerals, which Allah Almighty has made continuous and comprehensive, and which relate to a person's illness, death, and burial in the grave. This includes: visiting the sick, reminding them of the word of sincerity (Kalima Akhlas), performing ghusl (washing the body), providing the kafan (shroud), offering the funeral prayer, and the rules of burial; and within this context, issues such as paying off debts, executing wills, distributing inheritance, and caring for weak and vulnerable children are also included.
Comprehensiveness of Prophetic Guidance in the Chapter of Funerals
Imam Ibn Qayyim رحمه الله states:
"Regarding the funeral and all related matters, the Messenger of Allah ﷺ has given such complete instructions that distinguish us from other nations and encompass the worship of Allah Almighty in all circumstances, as well as treating the deceased with kindness and dealing with them in a way that benefits them in the grave and the Hereafter. For example: visiting the sick, prompting the dying to say good words, purifying them, and taking them to the graveyard with respect. Then the Muslim brothers of the deceased stand before their Lord in rows to offer the funeral prayer, praising and glorifying Allah Almighty, sending blessings upon the Prophet ﷺ, and then praying to Allah Almighty for forgiveness, mercy, and pardon for the deceased. Then, standing at the grave, they pray for steadfastness for the deceased during the trial in the grave, and in addition, the grave is visited from time to time and prayers are offered. In all these matters, the deceased is cared for in the same way that a person cares for their companion in life, and then kindness and goodness are shown to their family, relatives, etc."
Reference: Zaad al-Ma'ad 1/498. With slight modification.
The remembrance of death and preparation for the afterlife
It is Sunnah for every Muslim to remember death frequently, repent from sins and transgressions, prepare for the Hereafter, return the rights to those whom they have wronged and usurped, and engage in righteous deeds before death strikes suddenly. The Prophet ﷺ said:
"أَكْثِرُوا ذِكْرَ هادم اللَّذَّاتِ"
"Remember frequently the destroyer of pleasures (death)."
Reference: Jami` at-Tirmidhi, Zuhd (Book on Asceticism), Chapter: What has been related about remembering death, Hadith 2307, 2460; Sunan an-Nasa'i, Jana'iz (Funerals), Chapter: Frequent remembrance of death, Hadith 1925; Sunan Ibn Majah, Dhikr (Remembrance), Chapter: Death and preparing for it, Hadith 4258; Musnad Ahmad 2/292-293
Sayyiduna Ibn Mas'ud رضي الله عنه narrates that the Messenger of Allah ﷺ said:
"عَنْ عَبْدِ اللَّهِ بْنِ مَسْعُودٍ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: اسْتَحْيُوا مِنْ اللَّهِ حَقَّ الْحَيَاءِ، قَالَ: قُلْنَا: يَا رَسُولَ اللَّهِ، إِنَّا نَسْتَحْيِي وَالْحَمْدُ لِلَّهِ، قَالَ لَيْسَ ذَاكَ، وَلَكِنَّ الاسْتِحْيَاءَ مِنْ اللَّهِ حَقَّ الْحَيَاءِ: أَنْ تَحْفَظَ الرَّأْسَ وَمَا وَعَى، وَالْبَطْنَ وَمَا حَوَى، وَلْتَذْكُرْ الْمَوْتَ وَالْبِلَى وَمَنْ أَرَادَ الآخِرَةَ تَرَكَ زِينَةَ الدُّنْيَا فَمَنْ فَعَلَ ذَلِكَ فَقَدْ اسْتَحْيَا مِنْ اللَّهِ حَقَّ الْحَيَاءِ"
"Be truly ashamed before Allah as He deserves to be ashamed before." The Companions رضي الله عنهم said: "O Prophet of Allah ﷺ! We are ashamed before Allah, and we are grateful to Allah for it." He ﷺ said: "Not like that, but whoever is truly ashamed before Allah protects the head and what is in the head (thoughts). And take care of the stomach and what the stomach has gathered (that nothing haram enters into it). And remember death and decay. Whoever seeks the Hereafter abandons the adornment of the world. Whoever does this is truly ashamed before Allah as He deserves to be ashamed before Him."
Reference: (Da'if) Jami` at-Tirmidhi, Sifat al-Qiyamah (Characteristics of the Day of Judgment), Chapter: Concerning the explanation of what is required by being ashamed before Allah as He deserves to be ashamed, Hadith 2458; Da'if al-Jami' as-Saghir wa Ziyadatuhu, Hadith 805, 806
Patience During Illness and Supplication to Allah
When a person is afflicted with illness, he should be patient with the intention of reward, not panic, and not express displeasure with Allah's decree and destiny. However, there is no harm in telling someone about the nature or cause of the illness, but in all cases, he should be content with Allah's decision. Complaining about the illness and supplicating for healing before Allah is not against patience, but rather it is religiously desirable and recommended. Prophet Ayyub (Job) عليه السلام supplicated thus:
"(O my Lord!) Indeed, I have been afflicted with this disease, and You are the Most Merciful."
Reference: Al-Anbiya 21:83
Treatment and Abstinence from Forbidden Things
There is no harm in seeking treatment through permissible medicines; in fact, some scholars consider it necessary, and some consider it obligatory. Numerous hadiths indicate that seeking treatment does not contradict reliance (on Allah), just as eating and drinking to ward off hunger and thirst do not contradict reliance.
Treatment with forbidden things is absolutely not permissible. Sayyiduna Ibn Mas'ud رضي الله عنه said about an intoxicating substance:
"إنَّ اللَّهَ لَمْ يَجْعَلْ شِفَاءَكُمْ فِيمَا حَرَّمَ عَلَيْكُمْ "
"Allah Almighty has not placed your cure in what He has forbidden to you."
Reference: Narrated by Bukhari as a Mu'allaq, Al-Ashribah, Bab Sharaab Al-Halwaa wal-'Asal, before Hadith 5641
Sayyiduna Abu Hurairah رضي الله عنه narrates that the Messenger of Allah ﷺ said:
"إِنَّ اللَّهَ أَنْزَلَ الدَّاءَ وَالدَّوَاءَ وَجَعَلَ لِكُلِّ دَاءٍ دَوَاءً ، فَتَدَاوَوْا وَلاَ تَدَاوَوْا بِحَرَامٍ "
"Allah Almighty has sent down both the disease and the cure, and He has appointed a cure for every disease. So, seek treatment, but do not seek treatment with forbidden things."
Reference: (Weak Isnad) Sunan Abi Dawood, At-Tib, Bab Fi Al-Adwiyah Al-Makroohah, Hadith 3874
In Sahih Muslim, it is stated about alcohol:
"إِنَّهُ لَيْسَ بِدَوَاءٍ وَلَكِنَّهُ دَاءٌ"
"It is not a medicine, but a disease."
Reference: Sahih Muslim, Al-Ashribah, Bab Tahrim At-Tadaawi bil-Khamr wa Bayaan Annaha Laysat bi-Dawaa', Hadith 1984
Such treatments that are contrary to the beliefs of Islam are absolutely forbidden: such as believing in healing or warding off calamities by wearing amulets, beads, threads, necklaces, arm/wrist bracelets, etc., containing polytheistic/unknown words. All of these are forbidden because the heart becomes attached to other than Allah Almighty for benefit and harm; therefore, this is Shirk or a means to Shirk. Similarly, treatment through soothsayers, astrologers, magicians, and those who take service from jinn is also forbidden. Belief is more important to a Muslim than health. Allah Almighty has placed healing in permissible things that are beneficial for the body, mind, and religion. The most important thing is to perform Ruqyah (healing through recitation) with the Holy Quran and the prescribed supplications.
Imam Ibn Qayyim رحمه الله states:
"The best treatment is to supplicate to Allah Almighty along with remembrance and prayer, and to repent and seek forgiveness. Their effect is greater than the effect of medicines, but it depends on the extent to which the human soul is prepared for it and accepts it."
Reference: Zaad al-Ma'ad 4/144
Along with this, there is nothing wrong with getting treatment from expert doctors in hospitals etc. through permissible medicines.
The Ruling and Etiquette of Visiting the Sick
Visiting the sick is a Sunnah. The Messenger of Allah ﷺ said:
"خَمْس تَجِب لِلْمُسْلِمِ عَلَى أَخِيهِ "
"Every Muslim has five rights over another Muslim."
Reference: Sahih al-Bukhari, al-Jana'iz, Bab al-Amr bi Ittiba' al-Jana'iz, Hadith 1240; Sahih Muslim, al-Salam, Bab Min Haqq al-Muslim lil-Muslim Radd al-Salam, Hadith 2162
One of these rights is visiting the sick. When visiting, inquire about the patient's condition. The Prophet ﷺ used to go near the patient and ask about their well-being. Visits can be made every other day or every two days, but can also be done daily if the patient desires. Do not sit for too long without the patient's consent, and say:
"لا بَأْسَ طَهُورٌ إنْ شَاءَ اللهُ"
"There is no harm, إن شاء اللہ (this illness) will cleanse you of sins."
Reference: Sahih al-Bukhari, Kitab al-Tawhid, Bab Fi al-Mashiyyah wal-Iradah, Hadith 7470
Speak to the patient in a way that pleases them, pray for their recovery, and perform دم (blowing with saliva while reciting) with Quranic verses, especially by reciting Surah Al-Fatiha, Al-Ikhlas, and Al-Mu'awwidhatayn (Surah Al-Falaq and Surah An-Nas).
Writing a Will and Informing About Debts/Trusts
It is also Sunnah for the patient to make a will regarding their wealth, specifying that it should be spent on good causes. If they have debts or people's trusts, they should inform the heirs. In fact, concern for this is necessary even in good health, because the Messenger of Allah ﷺ said:
"مَا حَقُّ امْرِئٍ مُسْلِمٍ ، لَهُ شَيْءٌ يُوصَى فِيهِ ، يَبِيتُ لَيْلَتَيْنِ إِلَّا وَوَصِيَّتُهُ عِنْدَهُ مَكْتُوبَةٌ "
"It is the duty of every Muslim who has something to bequeath not to let two nights pass without writing a will concerning it."
Reference: Sahih al-Bukhari, Kitab al-Wasaya, Hadith 2738; Sahih Muslim, Kitab al-Wasiyyah, Bab Wasiyyat al-Rajul Maktubatan 'Indahu, Hadith 1627
The mention of two nights in the Hadith is for emphasis, not to set a limit; the meaning is that the will should be written because the time of death is unknown.
Having Good Expectations of Allah
The patient should have good expectations of Allah Almighty:
"أَنَا عِنْدَ ظَنِّ عَبْدِي بِي"
"I am as My servant thinks I am."
Reference: Sahih al-Bukhari, Kitab al-Tawhid, Bab Qawl Allah Ta'ala: "Wa Yuhadhirukumullahu Nafsah," Hadith 7405; Sahih Muslim, Kitab al-Dhikr wal-Du'a wal-Tawbah, Bab Fadl al-Dhikr al-Du'a, Hadith 2675
When a person feels that they are about to meet their Creator, the need for positive thinking increases. The person near death should be given hope of Allah's mercy, so much so that hope outweighs fear. However, in a state of health, hope and fear should be equal.
Instructing the Kalimah, Facing the Qiblah, and Surah Yasin
The person near death should be instructed to say "لَا إِلَهَ إِلَّا اللَّهُ" because the Messenger of Allah ﷺ said:
"لَقِّنُوا مَوْتَاكُمْ لَا إِلَهَ إِلَّا اللَّهُ"
"Instruct those who are dying among you to say 'لَا إِلَهَ إِلَّا اللَّهُ'."
Reference: Sahih Muslim, Funerals, Chapter on Instructing the Dying with "La Ilaha Illallah," Hadith 916
The aim is that death should occur on the word of sincerity (Kalimah Ikhlas) and that this should be the last word spoken. It is narrated from Sayyidna Mu'adh bin Jabal رضي الله عنه that the Messenger of Allah ﷺ said:
"مَنْ كَانَ آخِرُ كَلامِهِ لا إِلَهَ إِلا اللَّهُ دَخَلَ الْجَنَّةَ "
"Whoever's last words are 'La ilaha illallah' will enter Paradise."
Reference: Sunan Abi Dawud, Funerals, Chapter on Instruction, Hadith 3116
Instruction should be done gently and with love, without excessive insistence, so that the severity of the pain does not lead to denial. The person should be turned towards the Qiblah.
Surah Yasin should be recited near the person who is near death, because it is commanded:
"اقْرَءُوا يس عَلَى مَوْتَاكُمْ"
"Read Surah Yasin to those who are dying."
Reference: (Da'if) Sunan Abi Dawud, Funerals, Chapter on Recitation Near the Deceased, Hadith 3121; Sunan Ibn Majah, Funerals, Chapter on What is Said When Sickness is Present, Hadith 1448
Note: Reciting Surah Yasin near the deceased after death is an innovation (bid'ah), while reciting it near the person who is near death has been described as Sunnah. Similarly, reciting Surah Yasin etc. at the time of the funeral, at the grave, or for conveying reward (isal-e-thawab) is an innovation because there is no evidence for it in the Book and Sunnah.
Reference: The narration about reciting Surah Yasin near a person near death is very weak. (Sarim)
Rulings Regarding Death
When a person is confirmed to have died, it is recommended to close their eyes. It is narrated about Sayyiduna Abu Salama رضي الله عنه that the Prophet ﷺ closed his eyes and said:
"إِنَّ الرُّوحَ إِذَا قُبِضَ تَبِعَهُ الْبَصَرُ»، فَضَجَّ نَاسٌ مِنْ أَهْلِهِ، فَقَالَ: «لَا تَدْعُوا عَلَى أَنْفُسِكُمْ إِلَّا بِخَيْرٍ، فَإِنَّ الْمَلَائِكَةَ يُؤَمِّنُونَ عَلَى مَا تَقُولُونَ"
"When the soul is taken, the sight follows it." Then some of the family members started crying, so he ﷺ said: "Do not say anything but good for yourselves, because the angels say Amen to what you say."
Reference: Sahih Muslim, Al-Jana'iz, Chapter on Closing the Eyes of the Deceased and Praying for Him When He is Present, Hadith 920
After death, the deceased should be covered. Sayyidah Aisha رضي الله عنها says:
"أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ حِينَ تُوَفِّيَ سُجِّيَ بِبُرْدِ حِبَرَةٍ "
"When the Prophet ﷺ passed away, his blessed body was covered with a striped Yemeni cloth."
Reference: Sahih al-Bukhari, Al-Libas, Chapter on Burd, Habra, and Shamla, Hadith 5814
When death occurs, do not delay in preparing the body for burial:
"لاَ يَنْبَغِي لجِيفَةِ مُسْلِمٍ أنْ تُحْبَسَ بَيْنَ ظَهْرَانَيْ أَهْلِهِ"
"The corpse of a Muslim should not be kept for long among his family."
Reference: (Da'if) Sunan Abi Dawood, Al-Jana'iz, Chapter on Hastening the Funeral and the Dislike of Detaining It, Hadith 3159
The wisdom in this is to protect the deceased from change and decay. Imam Ahmad رحمه الله said: "Honoring the deceased is in taking him to the graveyard quickly."
Reference: Al-Mughni wa al-Sharh al-Kabir 2/310
If there is no fear of the body changing and close relatives are nearby, they can be waited for.
Announcing the death of a Muslim is permissible so that preparations can be made quickly, attendance at the funeral prayer is increased, and people can participate in the prayer. However, announcing with wailing or pride and exaggeration is from the days of ignorance (Jahiliyyah). Similarly, condolence gatherings and mourning assemblies are a return to the days of ignorance.
It is recommended to promptly execute wills so that the deceased may receive their reward quickly. In the Quran, the mention of wills precedes that of debts, the purpose being to clarify its importance. However, in light of the narration of Sayyidna Ali رضي الله عنه, according to the decision of the Prophet ﷺ, debt takes precedence over wills.
Reference: Jami` at-Tirmidhi, Fara'id, Bab Ma Ja'a Fi Mirath Al-Ikhwah, Hadith 2094; (Sarim)
After the will (and according to the Shari'a order), the debts of the deceased should be paid promptly, whether they are the rights of Allah, such as Zakat, Hajj, lawful vows, or expiations; or the rights of people, such as trusts, usurped or borrowed items. Whether the deceased made a will or not, payment is necessary in any case. The Prophet ﷺ said:
"نَفْسُ الْمُؤْمِنِ مُعَلَّقَةٌ بِدَيْنِهِ حَتَّى يُقْضَى عَنْهُ"
"The soul of a believer remains suspended because of his debt until it is paid off on his behalf."
Reference: Jami` at-Tirmidhi, Al-Jana'iz, Bab Ma Ja'a Anna Nafs al-Mu'min Mu'allaqah bi-Dainih, Hadith 1078; Musnad Ahmad 2/440
In this context, the incident of the funeral of a debtor and the details of debt repayment/guarantee are also mentioned.
Reference: Sahih al-Bukhari, Hadith 2289; Sunan Abi Dawud, Hadith 2054; (Sarim)
If the deceased does not have wealth but had a firm intention to pay, then Allah Almighty will pay on his behalf.
Reference: Sahih al-Bukhari, Al-Istiqraz, Bab Man Akhadha Amwal an-Nas Yuridu Ada'aha aw Itlafaha, Hadith 2387
Method and Issues of Ghusl (Bathing) for the Deceased
Among the rules of Jana'iz is that the deceased should be given Ghusl by someone who knows the method and is able to do it. When a person died after falling from a camel, the Prophet ﷺ said:
"اغْسِلُوهُ بِمَاءٍ وَسِدْرٍ"
"Wash him with water and lotus leaves."
Reference: Sahih al-Bukhari, Al-Jana'iz, Bab al-Kafan fi Thawbayn, Hadith 1265; Sahih Muslim, Al-Hajj, Bab Ma Yuf'alu bil-Muhrim Idha Mata?, Hadith 1206
The practice of giving ghusl to the deceased has been continuously practiced among the people of Islam. The Messenger of Allah ﷺ was also given ghusl after his death, even though he was pure both outwardly and inwardly—so why should another Muslim not be given ghusl? Giving ghusl to the deceased is a communal obligation (فرضِ کفایہ) upon those who are aware of the death.
Who Should Give Ghusl
① If the deceased is a male, then a male should give him ghusl. It is better if he is a trustworthy person who is knowledgeable about the relevant issues. If the deceased has made a will for a specific person to give him ghusl, then he should be given the opportunity, provided that he is reliable. Sayyiduna Abu Bakr Siddiq رضي الله عنه made a will that his wife, Sayyidah Asma bint Umays رضي الله عنها, should give him ghusl.
Reference: (Da'if) Al-Muwatta of Imam Malik, Al-Jana'iz, Bab Ghusl al-Mayyit, Hadith 3; Al-Mughni wa'l-Sharh al-Kabir 2/308-311; Irwa' al-Ghalil, Hadith 696
From this, the permissibility of a wife giving ghusl to her husband is established. Similarly, it is permissible for a man to give ghusl to his deceased wife, just as Sayyiduna Ali رضي الله عنه gave ghusl to Sayyidah Fatima رضي الله عنها.
Reference: Al-Mustadrak lil-Hakim, Ma'rifat al-Sahaba 3/163-164, Hadith 4769
Sayyiduna Anas رضي الله عنه had willed that Muhammad bin Sirin رحمه الله should give him ghusl.
Reference: Al-Mughni wa'l-Sharh 2/308; Sheikh Al-Albani said: "I have not found its chain of narration," Irwa' al-Ghalil, Hadith 697
② If there is no will, then the father should give ghusl, then the grandfather, then the male relatives on the father's side ('asabat - brother, uncle, etc.). If none are available or they do not know the method, then any stranger who knows the method can give ghusl.
③ If the deceased is a female, then a female should give her ghusl. If the woman specified in the will knows the method, then that is better, otherwise a knowledgeable woman from among the relatives.
④ A male or female can give ghusl to a child under the age of seven. Ibn al-Mundhir رحمه الله says that there is a consensus among the scholars that a woman can bathe a young child because the issue of covering the private parts does not apply in his life.
Reference: Al-Mughni wa'l-Sharh al-Kabir 2/313
And it is narrated that when the son of the Messenger of Allah ﷺ, Ibrahim عليه السلام, passed away, women gave him ghusl.
Reference: Minar al-Sabil p. 147; Shaykh al-Albani said in Irwa' al-Ghalil 3/163: I have not found it.
⑤ A woman should not give ghusl to a boy who is seven years old or older, and a man should not give ghusl to a girl who is seven years old or older.
Ruling Regarding the Corpse of a Disbeliever
It is not permissible for a Muslim to give ghusl to a dead disbeliever, carry his bier, shroud him, offer the funeral prayer for him, or participate in his funeral. Allah Almighty says:
﴿يـٰأَيُّهَا الَّذينَ ءامَنوا لا تَتَوَلَّوا قَومًا غَضِبَ اللَّهُ عَلَيهِم ...﴿١٣﴾... سورة الممتحنة﴾
"O you who have believed, do not take as allies a people upon whom is the anger of Allah."
Reference: Al-Mumtahanah 60:13
And He also said:
﴿وَلا تُصَلِّ عَلىٰ أَحَدٍ مِنهُم ماتَ أَبَدًا وَلا تَقُم عَلىٰ قَبرِهِ إِنَّهُم كَفَروا بِاللَّهِ ... ﴿٨٤﴾... سورة التوبة﴾
"And do not ever pray [the funeral prayer] over any of them who has died, nor stand at his grave. Indeed, they disbelieved in Allah and His Messenger."
Reference: At-Tawbah 9:84
And He said:
﴿ما كانَ لِلنَّبِىِّ وَالَّذينَ ءامَنوا أَن يَستَغفِروا لِلمُشرِكينَ ...﴿١١٣﴾... سورة التوبة﴾
"It is not for the Prophet and those who have believed to ask forgiveness for the polytheists."
Reference: At-Tawbah 9:113
It is also not for a Muslim to bury a disbeliever, but if there is no one to bury him, then a pit should be dug in the ground and the body should be hidden so that the living are not harmed by the stench and corruption. The incident of throwing the disbelievers of Badr into a well is well-known. The same ruling applies to an apostate (e.g., one who intentionally abandons prayer) or one who commits an innovation that leads to disbelief. A Muslim's stance towards a disbeliever, whether alive or dead, should be one of hatred and aversion, as was the stance of Ibrahim عليه السلام and the people of faith, as stated:
﴿إِذ قالوا لِقَومِهِم إِنّا بُرَءٰؤُا۟ مِنكُم وَمِمّا تَعبُدونَ مِن دونِ اللَّهِ كَفَرنا بِكُم وَبَدا بَينَنا وَبَينَكُمُ العَدٰوَةُ وَالبَغضاءُ أَبَدًا حَتّىٰ تُؤمِنوا بِاللَّهِ وَحدَهُ...﴿٤﴾... سورة الممتحنة﴾
"There has already been for you an excellent example in Abraham and those with him, when they said to their people, "Indeed, we are disassociated from you and from whatever you worship other than Allah ... There has appeared between us and you animosity and hatred forever..."
Reference: Al-Mumtahanah 60:4
And He said:
﴿لا تَجِدُ قَومًا يُؤمِنونَ بِاللَّهِ وَاليَومِ الءاخِرِ يُوادّونَ مَن حادَّ اللَّهَ وَرَسولَهُ وَلَو كانوا ءاباءَهُم أَو أَبناءَهُم أَو إِخوٰنَهُم أَو عَشيرَتَهُم... ﴿٢٢﴾... سورة المجادلة﴾
"You will not find a people who believe in Allah and the Last Day having affection for those who oppose Allah and His Messenger..."
Reference: Al-Mujadilah 58:22
Water and Place for Ghusl
The water for Ghusl should be pure, clean, and cool; it is permissible to heat it to remove dirt or in extreme cold. The Ghusl should be performed in a place protected from view: under a roof in a house or in a tent, etc. Before the Ghusl, it is necessary to cover the area from the navel to the knees with a cloth, then the clothes should be removed and the body laid on a plank that is slightly lower towards the feet so that the water flows towards the feet. Only the person giving the Ghusl and the assistants should be present in the Ghusl area; no extra people.
Method of Ghusl
The person giving Ghusl should slightly raise the head of the deceased, gently press the stomach and pass their hand over it so that any impurity is expelled, and water should be poured along with it so that it does not remain. Then, covering their hands with cotton/cloth gloves, they should perform Istinja (cleaning the private parts). Then, they should make the intention for Ghusl, say Bismillah, and perform Wudu (ablution) as for prayer, but rinsing the mouth and nose is not necessary; wiping the mouth/nose with a wet hand or damp cloth is sufficient. Then, the head and beard should be washed with water containing jujube leaves or soap. Then, the right side, including the neck, shoulder, arm, hand, and then the foot, should be washed; then, lifting the body onto its left side, the right side of the back should be washed; then the left side should be washed; then, lifting the body onto its right side, the left side of the back should be washed. Jujube leaves or soap should be used, and it is better to keep a glove on the hand.
If cleanliness is achieved, once is sufficient, but pouring water three times is recommended. If cleanliness is not achieved even after three times, it can be washed up to seven times. Camphor should be added to the water in the last wash because it is fragrant, cooling, and its effect lasts longer.
After the bath, the body should be dried, the mustache trimmed, nails cut if long, and armpit hair removed.
Reference: Al-Mughni al-Kabir 2/324-325
If the deceased is a woman, her hair should be braided into three strands and placed behind her.
If water is not available, or there is a fear of the body being damaged by water (e.g., a burnt body, leprosy, etc.), or if the deceased is a woman among men and neither her husband nor a female relative is present, or if the deceased is a man among women and neither his wife nor a male relative is present—then the deceased should be given Tayammum: the person performing the Tayammum should wrap a cloth around their hand and wipe the face and palms. If it is not possible to wash some parts of the body, then the possible parts should be washed, and Tayammum performed for the rest. It is recommended, but not obligatory, for the person giving the bath to perform Ghusl.
Rules Regarding Shrouding
After the bath and drying, the deceased should be shrouded. The shroud should be made of clothes that completely cover the body well, are clean, and new white clothes are preferred; washed clothes are also acceptable.
It is obligatory to shroud in one cloth, provided it covers the entire body, while it is recommended to use three cloths for men and five for women: a loincloth, a head covering, a shirt, and two large sheets for women. It is recommended to sprinkle rose water on the shroud and fumigate it with fragrance (frankincense, etc.) so that the effect remains.
Reference: The difference of three and five cloths for the shrouds of men and women is not proven by a Sahih Hadith, therefore, it is recommended to shroud in three cloths, which do not include a shirt.
Method of Shrouding
Three sheets should be taken and spread one on top of the other. The deceased should be brought in such a way that the necessary parts are covered, and laid flat on the sheets. Then, the left edge of the uppermost sheet should be placed over the deceased and hidden on the right side, then the right edge of the same sheet should be taken and placed on the left side. Then the second and third sheets should also be wrapped in the same way. The excess part of the sheet should be kept more towards the head, which should be placed over the face, and the excess part towards the feet should be placed over the feet. Then the sheets should be tied carefully so that they do not open until they are placed in the grave, and after placing them in the grave, the knots should be opened.
A woman should be shrouded in five pieces of cloth: one sheet as a loincloth, the second as a shirt, the third as a dupatta (headscarf), and two large sheets to cover the body.
Rules of Funeral Prayer
After shrouding the Muslim deceased, their funeral prayer should be offered. Sayyiduna Abu Hurairah رضي الله عنه narrated that the Messenger of Allah ﷺ said:
"مَنْ شَهِدَ الْجِنَازَةَ حَتَّى يُصَلَّى عَلَيْهَا فَلَهُ قِيرَاطٌ، وَمَنْ شَهِدَهَا حَتَّى تُدْفَنَ فَلَهُ قِيرَاطَانِ))، قِيلَ: وَمَا الْقِيرَاطَانِ؟ قَالَ: ((مِثْلُ الْجَبَلَيْنِ الْعَظِيمَيْنِ))"
"Whoever attends the funeral until the prayer is offered for it, will have one Qirat (of reward), and whoever stays until the burial, will have two Qirats." It was asked, "What are two Qirats?" He replied, "Like two great mountains."
Reference: Sahih al-Bukhari, Funerals, Chapter: Whoever waits till the deceased is buried, Hadith 1325; Sahih Muslim, Funerals, Chapter: The virtue of offering prayer for the deceased and following it, Hadith 945
Funeral prayer is a communal obligation (فرضِ کفایہ). If some people perform it, the rest are not sinful, but it remains a Sunnah for them. If no one performs it, everyone will be sinful.
Conditions for Funeral Prayer
① Intention.
② Facing the Qiblah.
③ Covering the 'Satr' (parts of the body that should be covered).
④ The purity of both the one praying and the deceased.
⑤ Removing impurities.
⑥ The one praying and the deceased being Muslim.
⑦ The presence of the body (if it belongs to the same city).
⑧ The one praying being 'mukallaf' (sane and adult).
Pillars of the Funeral Prayer
① Standing.
② Four Takbirs (saying "Allahu Akbar").
③ Surah Al-Fatiha.
④ Sending blessings upon the Prophet ﷺ.
⑤ Supplication for the deceased.
⑥ Maintaining order.
⑦ Saying Salam (peace be upon you).
Sunnahs of the Funeral Prayer
◈ Raising the hands with each Takbir.
◈ Saying "Audhu" (I seek refuge) before recitation.
◈ Supplicating for oneself and for the people of Islam.
◈ Reciting silently.
Reference: Sahih Muslim, Funerals, Chapter on Supplication for the Deceased in Prayer, Hadith 963 (Sarim)
◈ A slight pause between the fourth Takbir and the Salam.
◈ Placing the hands on the chest.
◈ Saying Salam only to the right side.
Reference: (Da'if) Sunan al-Daraqutni, Funerals, Chapter on Saying Salam Once in Funerals, 2/71, Hadith 1799; Al-Mustadrak of Al-Hakim 1/360, Hadith 1332
And saying Salam to both sides is also established.
Reference: Al-Sunan al-Kubra by Al-Bayhaqi 4/43; Ahkam al-Jana'iz by Al-Albani, pp. 162-164
Method of the Funeral Prayer
The person offering the funeral prayer, whether alone or as an Imam: If the deceased is a man, he should stand opposite his chest, and if she is a woman, he should stand opposite the middle of her body, while the followers stand behind the Imam.
Reference: If the deceased is a man, it is Sunnah to stand opposite his head: Ahkam al-Jana'iz by Al-Albani, p. 138 (A.D.)
It is Sunnah to form at least three rows. Then say the Takbir Tahrimah, and after saying "Audhu" and "Bismillah" without the Dua al-Istiftah, recite Surah Al-Fatiha. Then say the second Takbir and recite the Durood Sharif. Then say the third Takbir and recite the prescribed supplications for the deceased. Examples:
"اللَّهُمَّ اغْفِرْ لِحَيِّنَا وَمَيِّتِنَا وَصَغِيرِنَا وَكَبِيرِنَا وَذَكَرِنَا وَأُنْثَانَا وَشَاهِدِنَا وَغَائِبِنَا ، اللَّهُمَّ مَنْ أَحْيَيْتَهُ مِنَّا فَأَحْيِهِ عَلَى الْإِيمَانِ ، وَمَنْ تَوَفَّيْتَهُ مِنَّا فَتَوَفَّهُ عَلَى الْإِسْلَامِ ، اللَّهُمَّ لَا تَحْرِمْنَا أَجْرَهُ ، وَلَا تُضِلَّنَا بَعْدَهُ"
"O Allah! Forgive our living and our dead, our young and our old, our males and our females, those present and those absent."
O Allah! Keep alive those of us whom You keep alive on Islam, and cause those of us whom You cause to die to die on faith.
O Allah! Do not deprive us of his reward, and do not mislead us after him."
Reference: [Sunan Abi Dawood, al-Jana'iz, Bab al-Dua' lil Mayyit fi al-Salat, Hadith 3201; Jami' al-Tirmidhi, Hadith 1024; Sunan al-Nasa'i, Hadith 1988; Sunan Ibn Majah, al-Jana'iz, Bab Ma Ja'a fi al-Dua' fi al-Salat, Hadith 1498 (and the wording is his)]
"اللَّهُمَّ اغْفِرْ لَهُ وَارْحَمْهُ وَعَافِهِ وَاعْفُ عَنْهُ ، وَأَكْرِمْ نُزُلَهُ ، وَوَسِّعْ مُدْخَلَهُ ، وَاغْسِلْهُ بِالْمَاءِ وَالثَّلْجِ وَالْبَرَدِ ، وَنَقِّهِ مِنْ الْخَطَايَا كَمَا نَقَّيْتَ الثَّوْبَ الْأَبْيَضَ مِنْ الدَّنَسِ ، وَأَبْدِلْهُ دَارًا خَيْرًا مِنْ دَارِهِ ، وَأَهْلًا خَيْرًا مِنْ أَهْلِهِ ، وَزَوْجًا خَيْرًا مِنْ زَوْجِهِ ، وَأَدْخِلْهُ الْجَنَّةَ ، وَقِهِ فِتْنَةَ الْقَبْرِ وَعَذَابَ النَّارِ"
"O Allah! Forgive him, have mercy on him, grant him safety, and pardon him.
Make his hospitality honorable, and expand his grave.
Wash him with water, snow, and hail, and cleanse him from sins as You have cleansed the white cloth from dirt.
Grant him a better home than his home, a better family than his family, and a better wife than his wife.
Admit him to Paradise, and protect him from the trial of the grave and the punishment of the Fire."
Reference: [Sahih Muslim, al-Jana'iz, Bab al-Dua' lil Mayyit fi al-Salat, Hadith 963]
"وَافْسحْ لَهُ في قَبْرِهِ ، وَنَوِّرْ لَهُ فيه"
Reference: [Sahih Muslim, al-Jana'iz, Bab fi Ighmad al-Mayyit wal-Dua' Lahu Iza Hadar, Hadith 920]
If the deceased is a woman, then use the feminine pronoun.
Reference: The word "mayyit" (deceased) is an adjective, which applies to both masculine and feminine, so it is not necessary to change the pronouns.
If the deceased is a child, then this supplication should be recited:
"اللَّهُمَّ اجْعَلْهُ فَرَطَاً وَذُخْراً لِوَالِدَيْهِ، وشَفِيعاً مُجَاباً، اللَّهُمَّ ثَقِّلْ بِهِ مَوَازِيْنَهُمَا، وأعْظِمْ بهِ أُجُورَهُمَا، وألْحِقْهُ بِصَالِحِ الـمُؤْمِنينَ، واجْعَلْهُ فِي كَفَالَةِ إِبْرَاهِيمَ، وَقِهِ بِرَحْمَتِكَ عَذَابَ الجَحِيمِ، وأبْدِلْهُ دَاراً خَيْراً مِنْ دَارِهِ، وَأَهْلاً خَيْراً مِنْ أَهْلِهِ، اللَّهُمَّ اغْفِرْ لأسْلاَفِنَا، وَأَفْرَاطِنَا، وَمَنْ سَبَقَنا بالإيْمَانِ"
O Allah! Make him a resource and treasure sent ahead for his parents, and make him an intercessor whose intercession is accepted.
O Allah! Make heavy their scales through him, and make their reward great.
And join him with the righteous believers, and place him in the care of Ibrahim عليه السلام.
Protect him from the torment of Hell with Your mercy, and grant him a home better than his home, and a family better than his family.
O Allah! Forgive our predecessors, and our young children, and all those who have passed away before us with faith.
Reference: Al-Mughni wa al-Sharh al-Kabir 2/369
Then say the fourth Takbir and pause for a moment.
Reference: Al-Sunan al-Kubra lil Bayhaqi 4/35
Then give one Salam to the right.
Reference: (Da'if) Sunan al-Daraqutni 2/71 Hadith 1799; Al-Mustadrak lil Hakim 1/360 Hadith 1332
If someone joins the funeral prayer late, he should join with the Imam. When the Imam says the Salam, he should complete the missed part and then say the Salam. If there is a concern that the funeral will be carried away immediately after the Salam, then he should quickly complete the Takbirs and say the Salam.
If he could not offer the funeral prayer before the burial, then he should stand facing the Qibla in front of the grave and offer the funeral prayer.
If a fetus is miscarried and is four months or older, then the funeral prayer should be offered, and if it is less than four months old, then it should be buried without prayer.
Reference: Al-Mughni wa al-Sharh al-Kabir 2/393; Ahkam al-Jana'iz lil-Albani p:104 (A.D)
Taking the Deceased to the Graveyard and Burial
Shouldering the deceased and burying them is a communal obligation (Fard Kifaya) upon Muslims. The proof of burial is from the Book and Sunnah. Allah Almighty says:
﴿أَلَم نَجعَلِ الأَرضَ كِفاتًا ﴿٢٥﴾ أَحياءً وَأَموٰتًا ﴿٢٦﴾... سورة المرسلات﴾
"Have We not made the earth a container, For the living and the dead."
Reference: Al-Mursalat 77:25-26
And He said:
"ثُمَّ أَمَاتَهُ فَأَقْبَرَهُ"
"Then He causes him to die and provides a grave for him."
Reference: Abasa 80:21
It is Sunnah to join the funeral procession and accompany it to the grave, and the narration of the reward of a Qirat also indicates this.
Reference: Sahih al-Bukhari Hadith 1325; Sahih Muslim Hadith 945
The person accompanying the funeral should try to be among those who give shoulder to the bier. If the graveyard is far, there is no harm in taking it on a vehicle or animal. While carrying the funeral, one should walk at a reasonable pace:
"أَسْرِعُوا بِالْجِنَازَةِ ، فَإِنْ تَكُ صَالِحَةً فَخَيْرٌ تُقَدِّمُونَهَا ، وَإِنْ يَكُ سِوَى ذَلِكَ فَشَرٌّ تَضَعُونَهُ عَنْ رِقَابِكُمْ"
Reference: Sahih al-Bukhari, Funerals, Chapter on Speed in Carrying the Funeral, Hadith 1315; Sahih Muslim, Funerals, Chapter on Hastening the Funeral, Hadith 944
This does not mean running excessively, but walking with composure. Raising voices in recitation, saying "La ilaha illallah," or making collective sounds of dhikr/istighfar while carrying the funeral is a bid'ah (innovation).
It is haram (forbidden) for women to go with the funeral procession:
"نُهِينَا عَنْ اتِّبَاعِ الْجَنَائِزِ"
"We were forbidden from following funerals."
Reference: Sahih al-Bukhari, Funerals, Chapter on Women Following Funerals, Hadith 1278
The State of the Grave and the Method of Burial
It is Sunnah to make the grave deep and wide:
"احْفِرُوا وَأَعْمِقُوا وَأَوْسِعُوا"
"Dig the grave, make it deep, and make it wide."
Reference: Sunan Abi Dawood, Funerals, Chapter on Deepening the Grave, Hadith 3216; Sunan Abi Dawood, Funerals, Chapter on Deepening the Grave, Hadith 3215; Jami' al-Tirmidhi, Jihad, Chapter on What Has Been Related About Burying the Martyrs, Hadith 1713
It is Sunnah to arrange for a screen when lowering a woman into the grave.
When lowering into the grave, one should say:
"بِسْمِ اللهِ ، وَعَلَى مِلَّةِ رَسُولِ اللهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّم"
In the name of Allah, and according to the way (religion) of the Messenger of Allah ﷺ.
Reference: Jami' al-Tirmidhi, Funerals, Chapter on What to Say When the Deceased is Placed in the Grave, Hadith 1046; Sunan Abi Dawood, Funerals, Chapter on Supplication for the Deceased When Placed in His Grave, Hadith 3213; Musnad Ahmad 2/27
The deceased should be laid on their right side, with their face towards the Qiblah, because he ﷺ said:
"قِبْلَتكُمْ أَحْيَاءً وَأَمْوَاتًا"
"Whether you are alive or dead, the Kaaba is your Qiblah in both states."
Reference: Sunan Abi Dawood, Wills, Chapter on What Has Been Related About Being Strict Regarding Consuming the Wealth of the Orphan, Hadith 2875
An brick/stone should be placed under the head, or the head should be elevated by making a mound of soil, the face should be close to the facing wall, and soil should be placed behind the back as support so that the body does not turn over. The niche should be closed with soil and unbaked bricks, and the same soil that was removed during digging should be used, without adding extra soil.
The grave should be raised one hand-span high (like a camel's hump) so that water does not accumulate, pebbles should be placed on it, and water should be sprinkled to settle the soil. The purpose of keeping it one hand-span high is to mark the grave so that it is not trampled upon. It is permissible to demarcate the area around it with stones, but writing on the grave is prohibited.
After burial, it is recommended to stand at the grave and pray for forgiveness for the deceased. After finishing the burial, the Messenger of Allah ﷺ would say:
"اسْتَغْفِرُوا لأَخِيكُمْ وَاسْأَلُوا لَهُ التَّثْبِيتَ فَإِنَّهُ الآنَ يُسْأَلُ"
Reference: [Sunan Abi Dawood, Funerals, Chapter on Seeking Forgiveness at the Grave for the Deceased at the Time of Departure, Hadith 3221]
Recitation of the Quran at the grave is not proven from the Messenger of Allah ﷺ nor from the Companions, so it is an innovation.
It is forbidden to construct buildings over graves, to make them solid, and to write on them. It is narrated from Sayyidna Jabir رضي الله عنه:
"نَهَى رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ أَنْ يُجَصَّصَ الْقَبْرُ، وَأَنْ يُقْعَدَ عَلَيْهِ، وَأَنْ يُبْنَى عَلَيْهِ"
The Messenger of Allah ﷺ forbade:
- That the grave be plastered (made solid),
- That one sits on it,
- Or that any building be constructed upon it.
Reference: [Sahih Muslim, Funerals, Chapter on the Prohibition of Plastering Graves and Building Upon Them, Hadith 970]
And:
"نَهَى النَّبِيُّ -صلى الله عليه وسلم- أَنْ تُجَصَّصَ القُبُورُ، وَأَنْ يُكْتَبَ عَلَيْهَا، وَأَنْ يُبْنَى عَلَيْهَا، وَأَنْ تُوطَأَ"
The Prophet ﷺ forbade:
- That graves be plastered (made solid),
- That anything be written on them,
- That buildings be constructed upon them,
- And that they be walked upon (trampled).
Reference: [Jami' al-Tirmidhi, Funerals, Chapter on What Has Been Related About the Dislike of Plastering Graves and Writing on Them, Hadith 1052]
Illuminating graves, building mosques there, and praying near graves or facing them is forbidden:
"لعن رسول الله صلى الله عليه وسلم زائرات القبور"
The Messenger of Allah ﷺ cursed women who frequently visit graves.
Reference: Jami` at-Tirmidhi, Jana'iz; Sunan Ibn Majah, Jana'iz, Chapter on what has come regarding the prohibition of women visiting graves, Hadith 1574, 1576
Regarding the Jews and Christians, he ﷺ said:
"لَعَنَ اللَّهُ الْيَهُودَ وَالنَّصَارَى اتَّخَذُوا قُبُورَ أَنْبِيَائِهِمْ مَسَاجِدَ"
May Allah curse the Jews and Christians, for they took the graves of their prophets as places of worship (mosques).
Reference: Sahih al-Bukhari, Jana'iz, Chapter on what has come regarding the grave of the Prophet ﷺ, Hadith 1390
Walking on graves, trampling them with shoes, sitting on them, throwing garbage on them, or diverting water drainage towards them is disrespect to the graves and is forbidden:
"لأَنْ يَجْلِسَ أَحَدُكُمْ عَلَى جَمْرَةٍ فَتُحْرِقَ ثِيَابَهُ فَتَخْلُصَ إِلَى جِلْدِهِ خَيْرٌ لَهُ مِنْ أَنْ يَجْلِسَ عَلَى قَبْرٍ"
For one of you to sit on a burning ember, which would burn through his clothes and reach his skin—
that is better for him than sitting on a grave.
Reference: Sahih Muslim, Jana'iz, Chapter on the prohibition of sitting on graves and praying on them, Hadith 971
According to Imam Ibn al-Qayyim رحمه الله, the aspect of respecting the deceased is prominent in these prohibitions.
Reference: Hashiyat Ibn al-Qayyim 9/37
Rulings on Condolences and Visiting Graves
It is recommended to offer condolences to the bereaved family, encourage them to be patient, and pray for the deceased. It is narrated from Sayyidna 'Amr bin Hazm رضي الله عنه that the Messenger of Allah ﷺ said:
"مَا مِنْ مُؤْمِنٍ يُعَزِّي أَخَاهُ بِمُصِيبَةٍ إِلَّا كَسَاهُ اللَّهُ سُبْحَانَهُ مِنْ حُلَلِ الْكَرَامَةِ يَوْمَ الْقِيَامَةِ"
Whoever consoles a believing brother in his affliction, Allah سبحانهٗ و تعالیٰ will clothe him with garments of honor and dignity on the Day of Resurrection.
Reference: (Da'if) Sunan Ibn Majah, Jana'iz, Chapter on what has come regarding the reward of one who consoles the afflicted, Hadith 1601; Irwa' al-Ghalil 3/216, Hadith 764
① In condolences, words should be said that mean: "May Allah give you a great reward, grant you beautiful patience, and forgive your deceased."
② Arranging gatherings and announcements for condolences (as is the custom today) is not permissible according to Sharia.
It is recommended to prepare and send food for the bereaved family:
"اصْنَعُوا لِأَهْلِ جَعْفَرٍ طَعَامًا فَإِنَّهُ قَدْ جَاءَهُمْ مَا يَشْغَلُهُمْ"
Prepare food for the family of Ja'far ﷺ, because a calamity has befallen them that is keeping them occupied (and sorrowful).
Reference: [Jami` at-Tirmidhi, Funerals, Chapter on what has been reported about preparing food for the family of the deceased, Hadith 998; Musnad Ahmad 1/205]
However, gathering people to prepare food at the house of the deceased, paying reciters to recite the Quran, and bearing financial burdens—this is innovation and forbidden. Imam Ahmad رحمه الله narrates from Sayyidna Jarir bin Abdullah رضي الله عنه:
"كُنَّا نَعُدُّ الِاجْتِمَاعَ إِلَى أَهْلِ الْمَيِّتِ وَصَنِيعَةَ الطَّعَامِ بَعْدَ دَفْنِهِ مِنَ النِّيَاحَةِ "
We (the Companions) considered gathering at the house of the deceased and preparing food there after the burial to be a form of wailing (mourning).
Reference: [Musnad Ahmad 2/204]
According to Shaykh al-Islam Ibn Taymiyyah رحمه الله, gathering people for meals, arranging recitations, and giving gifts by the bereaved family was not known among the Salaf, and scholars have deemed it undesirable for various reasons.
Allama Tartushi رحمه الله mentioned that condolence gatherings and gatherings at the time of calamity are forbidden and a reprehensible innovation, and there is no Sharia evidence for the second, third, fourth, seventh day ceremonies, monthly gatherings, or annual anniversaries/Urs. If this expense is from the inheritance and a heir has not permitted it, or if a heir is a minor, then this expense and its food are both haram.
Visiting Graves
③ It is recommended for men to visit graveyards, provided the purpose is to take heed and advice, and to pray for forgiveness for the deceased:
"كنت نهيتكم عن زيارة القبور ألا فزوروها"
I had forbidden you from visiting graves, but now listen! Visit them.
Reference: Sahih Muslim, al-Jana'iz, Bab Istidhan an-Nabi ﷺ Rabbahu 'azza wa jall fi Ziyarat Qabr Ummihi, Hadith 977
And there is an addition in Jami' al-Tirmidhi:
"فَإِنَّهَا تُذَكِّرُ الآخِرَةَ "
Indeed, it (visiting graves) reminds one of the Hereafter.
Reference: Jami' al-Tirmidhi, al-Jana'iz, Bab Ma Ja'a fi al-Rukhsah fi Ziyarat al-Qubur, Hadith 1054
④ Three conditions have been mentioned for visiting graves:
1. The visitors should be men, not women, because:
"لعن الله زائرات القبور"
Allah Almighty curses women who visit graves.
Reference: Al-Sunan al-Kubra lil-Bayhaqi 4/78; Musnad Abi Dawud al-Tayalisi, Hadith 2478
In the same place, a detailed point is also mentioned regarding the exaggerated wording of the hadith.
Reference: The exaggerated word "" mentioned in the hadith should be kept in mind... (Sahih al-Bukhari, Hadith 1252; Sahih Muslim, Hadith 974)
2. One should not travel to another city for the purpose of visiting:
"لا تُشَدُّ الرِّحَالُ إِلاَّ إِلَى ثَلاثَةِ مَسَاجِد"
(For the purpose of worship) travel should not be undertaken except to three mosques.
Reference: Sahih al-Bukhari, Fadl al-Salat fi Masjid Makkah wal-Madinah, Hadith 1189; Sahih Muslim, al-Hajj, Bab Fadl al-Masajid al-Thalatha, Hadith 1397
3. The purpose should be to take heed and advice and to pray for the deceased. If the purpose is seeking blessings or fulfillment of needs/removal of difficulties, then this is innovation (bid'ah), rather even shirk.
Shaykh al-Islam Ibn Taymiyyah رحمه الله states that visiting is of two types: Shar'i (lawful) and Bid'i (innovated); in the Shar'i type, there is greeting and prayer (without undertaking travel), and in the Bid'i type, there is seeking needs from the deceased, which is "major shirk," and making the grave or the occupant of the grave a means is bid'ah and a means to shirk.
Reference: Majmu' al-Fatawa 24/326-327, with slight modification.
Conclusion
ھذا ما عندی والله اعلم بالصواب