Wa `alaykum As-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
1- The prayer upon the dead is ultimately a supplication and mercy which benefits the demised as well as those still alive.
2- Muslims should not miss the great reward of offering Janazah. The funeral prayer is a collective obligation or fard kifayah for men.
3- It is permissible to pray Janazah in absentia.
In response to the question in point, the European Council for Fatwa and Research issued the following Fatwa:
All scholars agree that Janazah prayer is to be performed upon a present dead person and that the coffin is to be laid before the imam and the Muslims present. This was supported by the statements, actions and approvals of the Prophet Muhammad (peace and blessings be upon him). As for praying upon a dead person who is absent, this is affirmed by virtue of a number of famous authentic Hadiths such as that the Prophet (peace and blessings be upon him) offered janazah prayer upon an-Najashi (King of Abyssinia) when he died.
The Prophet (peace and blessings be upon him) said, “Today a good man has died in the land of Abyssinia, so stand up and pray upon him.” Jabir ibn `Abdillah said: “We then stood in lines and the Prophet Muhammad (peace and blessings be upon him) offered janazah prayer upon him with us standing behind in lines.” (Muslim, Abu Dawud, At-Tirmithi, An-Nasa’i and Ibn Majah)
In another narration, the Prophet (peace and blessings be upon him) stated: “A brother of yours has died, so stand up and pray upon him.” (Al-Bukhari and Muslim)
The prayer upon the dead is ultimately a supplication and mercy which benefits the demised as well as those still alive, and that is the reason for the Prophet praying upon an-Najashi. This agrees with the view of the Shafi`i and Hanbali Schools. It is wrong to say that the Prophet offered janazah prayer upon an-Najashi because no one else did so, because the hadiths do not state that no one offered janazah prayer upon him. Indeed the hadiths clearly stated that the reason for the prayer was that he was a good man.
It is also correct to pray upon someone who had already been prayed upon. In an authentic hadith, Yazid Ibn Thabit, the brother of Zaid, narrated: We went with the Prophet Muhammad (peace and blessings be upon him) and when we passed by al-Baqi’ (the graveyard), we saw a new grave had been dug and someone had been buried. The Prophet asked who it was. He was told: a Muslim woman called so and so.
The Prophet recognized her and said: “Why did you not tell me about her death?” They said: “O Messenger of Allah, you were resting and fasting and we did not wish to trouble you.” He (peace and blessings be upon him) said: “Do not repeat this again. If anyone dies while I am among you, you must tell me, because my prayer upon them is mercy.” He then approached the grave and we lined behind him and then he made four takbirs (i.e. he performed Janazah prayer).
Thus, Prophet Muhammad (peace and blessings be upon him) repeated the prayer upon a Muslim woman after she had been prayed upon and buried.
In short, it is our view that it is permissible to pray Janazah in absentia unless it becomes an unbroken habit, which then deems it unacceptable. This is because the Muslim Ummah never offered janazah prayer upon each and every absent person who had passed away; rather they did it when the person was of a certain status and respect in the eyes of the Muslims, such as an-Najashi, who supported and protected the Muslims, and the black woman who used to clean the Mosque of the Prophet Muhammad (peace and blessings be upon him). Abu Hurairah (may Allah be pleased with him) is reported to have said: There was a black woman who used to clean the mosque. The Prophet (peace and blessings be upon him) once noticed that she was absent and asked about her. He was told that she had died.
He (peace and blessings be upon him) said: “Why did you not tell me?” They responded in a way which conveyed that she was of little importance. The Prophet Muhammad said: “Show me her grave,” and he offered janazah prayer upon her. He (peace and blessings be upon him) then said: “These graves are full of darkness upon those who inhabit them and Allah enlightens them by virtue of my prayer upon them.”(Al-Bukhari and Muslim)
Finally, we wish to remind all the brothers and sisters that this remains a controversial matter, and thus we should refrain from criticizing anyone who wishes to choose one view or another.
Almighty Allah knows best.
Excerpted, with slight modifications, from: www.ecfr.org