Answered by Shaykh Rami Nsour
Question: Is it disliked to pray for Muslims who kill?
Prayer for a Deceased Muslim
The Messenger of Allah (peace and blessing be upon him) taught us to perform the funeral prayer (janazah) for every single person that passed away as a Muslim. He would only ask whether or not a person was Muslim to perform the prayer, which would include asking forgiveness for the deceased.
The Messenger of Allah (peace and blessing be upon him) was also very regular in asking forgiveness for his entire community (umma) as Allah had ordered him to do so [Quran 47:19]. The Prophet (peace and blessings be upon him) was well aware that would include people who had committed every type of sin.
The Vastness of Mercy
One teaching that we learn from asking for forgiveness of people who have transgressed is a reminder of the vastness of the Mercy of Allah (the majestic) and how He can forgive any sin except for associating partners with Him [Quran 4:48]. We also learn to ask forgiveness for those who oppress us as the Prophet(peace and blessing be upon him) did during the Battle of Uhud when he was hit in the face and injured.
With blood dripping form his face, he said, “O Allah, forgive my people for they know not what they do” [Bukhari]. One of the scholars said that the verse that give us the most hope is, “Say, ‘O my servants who have transgressed against themselves, do not despair of the Mercy of Allah. Indeed Allah forgives all sins” [Quran 39:53].
Prayer for an Oppressor Does Not Preclude Justice
It is important to note that while we pray for the forgiveness of all Muslims, that does not prevent us from establishing justice. Although the Prophet (peace and blessing be upon him) made dua for his enemies at Uhud, he continued in the battle against them until he defeated them. We have compassion for oppressors and criminals, but that does not prevent us from ensuring that justice is fulfilled through the routes of authority and courts.
And Allah knows best