When the Funeral Prayer and the Obligatory Prayer occur together
Question :
What is the ruling if a person enters the Masjid and finds the people praying over a deceased person during a time period that is short, like the time for the Maghrib prayer, and the person has not prayed yet? Does he pray the funeral prayer over the deceased or does he pray the obligatory prayer?
Answer:
It is permissible for him to prefer the funeral prayer if he does not fear that the time for the obligatory prayer will expire. This is because he might miss the funeral prayer, but he will not miss the obligatory prayer. So, in this case he will combine the two virtuous acts (i.e., offering both of the prayers). However, if he fears missing the time (of the obligatory prayer), he should start by praying the obligatory prayer and leave the prayer over the deceased. This is because the funeral prayer is Fardh Kifayah (a collective obligation on the community) that is fulfilled by someone praying over the deceased. The perfor- mance of the prayer within its prescribed time is a condition of the prayer, but it is extensive, i.e., permissible to perform the prayer earlier or later within these bounds - until their remains only enough time sufficient to perform it. Then, it becomes restricted, in which case it is required of the person to offer the obligatory prayer at that time (i.e., immediately). Success is with Allah, and may He send blessings and peace upon our Prophet Muhammad, his family and his Companions.
Source:
The Permanent Committee
Fatawa Islamiyah, Vol. 3 Page 62