Sayyiduna Imran bin Husayn (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) sent out a detachment, and a man attacked a man from the polytheists. When he overcame him with his spear, the man said: I am a Muslim, but he killed him anyway. Then he came to the Prophet (peace and blessings be upon him) and said: I have committed a sin, so ask forgiveness for me. He (peace and blessings be upon him) said: "What is that?" He said: I attacked a man from the polytheists, and when I overcame him with my spear he said: I am a Muslim, but I thought he was only seeking protection, so I killed him. He (peace and blessings be upon him) said: "Why did you not split open his heart so that it would become clear to you?" He said: Would it have become clear to me, O Messenger of Allah? He (peace and blessings be upon him) said: "He told you with his tongue, and you did not believe him about what was in his heart." The narrator said: Then that man died and we buried him, and in the morning he was found on the surface of the ground. We ordered our young men and they guarded him, yet in the morning he was found on the surface of the ground. We said: Perhaps they were negligent, so we guarded him ourselves, yet in the morning he was found on the surface of the ground. We came to the Prophet (peace and blessings be upon him) and told him (peace and blessings be upon him), and he (peace and blessings be upon him) said: "Indeed, the earth accepts those worse than him, but Allah wants to teach you the gravity of the sanctity of blood." Then he said: "Take him to the foot of this mountain and heap stones over him." So we did so.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 15653