Fiqh-us-Sunnah Volume 4, Funerals and Dhikr, Fiqh 4.054.

Section : The Most Worthy Person to Lead a Funeral Prayer.

Jurists differ as to the most worthy person to lead a funeral prayer. Some said: “The most appropriate person is the legal guardian of the deceased, then the (Muslim) ruler, then the father of the deceased, grandfather, or great grandfather, then the son or the grandson, then the one closest in relationship. This is the opinion of the Maliki and Hanbali schools. Others said: The best person is the father, then the grandfather, then the son, then the grandson, then the brother, then the nephew, then the paternal uncle, and then his son in accordance with their blood ties with the deceased. This is the opinion of AshShafi’i and Abu Yusaf. Abu Hanifah and Muhammad ibn Al-Hasan, however, are of the opinion that the preferred order is the (Muslim) ruler if present at the funeral, then the judge, then the imam of the locality, then the guardian of a deceased woman, then the nearest blood relative. Of the blood relatives, if both father and his son are present, the father should be given precedence.