Usamah bin Zaid (May Allah be pleased with them) reported: Messenger of Allah (PBUH) sent us to Huraqat, a tribe of Juhainah. We attacked that tribe early in the morning and defeated them, (then) a man from the Ansar and I caught hold of a man (of the defeated tribe). When we overcame him, he said: 'La ilaha illallah (There is no true god except Allah).' At that moment, the Ansari spared him, but I attacked him with my spear and killed him. By the time we went back to Al-Madinah, news had already reached Messenger of Allah (PBUH). He said to me, "O Usamah, did you kill him after he professed La ilaha illallah (There is no true god except Allah)?" I said, "O Messenger of Allah! He professed it only to save his life." Messenger of Allah (PBUH) repeated, "Did you kill him after he had professed La ilaha illallah?" He went on repeating this to me until I wished I had not embraced Islam before that day (so that I would have not committed this sin).
Another narration is: Messenger of Allah (PBUH) said, "Did you kill him in spite of his professing La ilaha illallah?" I said, "O Messenger of Allah! He said out of fear of our arms." He (PBUH) said, "Why did you not cut his heart open to find out whether he had done so sincerely or not?" He continued repeating it until I wished that I had embraced Islam only that day.