Usama ibn Zayd narrates,
The Messenger of Allah, may Allah bless him and grant him peace, sent us to al-Huraqa, a sub-tribe of Juhayna, and we came upon the people in the morning at their springs. A man of the Ansar and I overtook one of their men. When we descended on him, he said:
'There is no god but Allah.'
The Ansari held back from him, but I stabbed him with my spear until I had killed him. When we arrived in Madina, that reached the Prophet and he said:
'O Usama, did you kill him after he had said, "There is no god but Allah"?'
I said:
'Messenger of Allah, he was only trying to save himself.'
God's Messenger, getting very angry, replied to him:
'Did you then split open his heart so that you know whether he truly meant it when he said it or not?'
He continued to repeat it until I wished that I had only become Muslim on that day.