It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that Sayyiduna Umar (may Allah be pleased with him) was given ghusl (ritual washing), was shrouded, and the funeral prayer was offered for him, even though he was a martyr.
Imam Malik (may Allah have mercy on him) received from the people of knowledge that they used to say: Martyrs should neither be given ghusl nor should the funeral prayer be offered for them; rather, they should be buried in the very clothes in which they were martyred.
Imam Malik (may Allah have mercy on him) said: This method is for those martyrs who are killed in the battlefield and die there, and whoever is brought alive from the battlefield and then lives for a while and dies, then he should be given ghusl and the funeral prayer should be offered for him, as was done for Sayyiduna Umar (may Allah be pleased with him).