If a person died by suicide. Is it permissible in Islam for the people to pray his death pray (Salat-ul-Janaaza)?
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His Slave and Messenger.
It is confirmed in the narration reported by Imam Muslimthat a dead man who killed himself with large arrows was brought to the Prophet to pray on him and he refused. Imam An-Nawawi said in his interpretation of this narration: 'This narration is evidence for those who are of the view that it is not permissible to pray on someone who committed suicide because of such disobedience.' This is the view of 'Umar Ibn 'Abdul-'Azeez and Al-Awza'i. However, Al-Hassan, An-Nakh'ee, Qutadah, Malik, Abu Haneefah, Ash-Shafi'ee and the majority of the scholars, may Allah have mercy on all of them, are of the view that it is permissible to pray on him. They argued that the Prophet did not pray on him as a way to deter other people from committing the same sin; however, the companions prayed on him. The evidence for this is the same narration reported by An-Nasa'ee with the following wording: "As far as I am concerned, I am not going to pray on him."
Imam An-Nawawi reporting the words of Al-Qadhi 'Iyadh said: 'The view of all the scholars is that it is permissible to pray on the one who is killed by capital punishment, or stoned to death, or committed suicide, or born out of illegal sexual intercourse.' However, Imam Malikand others are of the view that 'an Imam should avoid praying on a person who is killed by capital punishment, and that the people of virtue should not pray on dissolute people as a way of deterrence to others like him.'
To conclude, it is permissible to pray on a person who committed suicide, even if he was a wise person and knew what he was doing and saying, according to the most preponderant opinion of the scholars. But a scholar should not pray on him as a way to deter other people from committing the same sin.