In Islam, burying a deceased person as soon as possible is not only a recommendation but also considered one of the important religious duties. In the jurisprudence of both Sunni and Shia schools, it is considered obligatory to wash, shroud, perform the funeral prayer, and bury the deceased without delay. This approach is based on the Prophet Muhammad's (PBUH) hadith, "Hasten the funeral..." The hadith states: "Hasten the funeral. If he was a righteous person, you are sending him to good. If not, you are removing a burden from your shoulders." (Sahih al-Bukhari, Sahih Muslim).
Imam Nawawi, a renowned scholar of Sunni jurisprudence, in his commentary on this hadith, emphasizes that delaying the funeral without a valid reason is disliked (makruh), and burying it as soon as possible is considered in accordance with the Sunnah. Ibn Qudamah also, in his work "Al-Mughni," does not consider delaying the burial correct in the absence of necessity.
The same approach exists in Shia jurisprudence. Among contemporary Shia Marja' al-Taqlid, Ayatollah Sayyid Ali Sistani recommends not delaying the washing, shrouding, and burial of the deceased as much as possible.
In this context, the fact that the p of Iran's late Supreme Leader, Sayyid Ali Khamenei, who died as a result of the war, was not buried for more than 4 months is not unequivocally accepted.

Speaking to Modern.az on the matter, Jeyhun Mammadov, a member of the Milli Majlis Committee on Public Associations and Religious Organizations, stated that in Islam, it is recommended to bury a deceased person as soon as possible, and this is considered religiously appropriate.
The MP added that the issue concerning Khamenei cannot be viewed solely from a religious perspective:
"During that period, the security factor played a key role. Because the war situation in the country was still ongoing, and there was a necessity to wait for the organization of the funeral ceremony. It would not be correct to approach the issue only from a religious aspect. Here, security, organizational matters on an international scale were also taken into account. The participation of numerous representatives from various countries, heads of state, government officials, and other high-ranking officials was expected at the funeral ceremony.

Theologian Elshad Miri, commenting on the issue, noted that the main purpose and focus of Islam is not the deceased person, but to guide the life of the living person:
"Islam teaches people how to live, what values to rely on, and how to determine their path in life. In Islam, how long a person is kept after death is not the main issue. Islam deals with the living, guides them, and teaches them how to behave in life. Issues such as where the deceased stays, how many days they are kept, whether they are preserved in a refrigerator, whether their relatives are present during the burial, or whether they are buried facing the Qibla do not constitute the essence of Islam. These are issues that are later associated with religion and presented as religious rulings."
Theologian noted that in the past, due to the lack of technical capabilities, people could not keep the deceased for a long time and buried them in a short period: "Today, however, refrigeration systems, special preservation, and other modern facilities are available. After all, Islam does not change with time. Therefore, it is not correct to present issues such as the time of burial or shrouding as the main purpose of religion.
Today, everyone knows that it is not possible to keep a deceased person at home for a long time without medical intervention and appropriate conditions. Even the closest person is forced to bury their loved one after a certain time. This stems not from religious but from natural and medical necessity. Therefore, I believe that such issues have no relevance to religion; they have simply begun to be presented as religious matters over time. The main purpose of Islam is to guide the living, to help a person find the right direction in the whirlwind of life."