It is narrated from Abdur Rahman bin Abdullah bin Ka'b bin Malik (may Allah have mercy on him) that Ka'b bin al-Ashraf, the Jew, was a poet. In his poetry he used to satirise the Messenger of Allah (peace and blessings be upon him) and his (peace and blessings be upon him) Companions, and incite the disbelievers of Quraysh against them. When the Messenger of Allah (peace and blessings be upon him) came to Madinah, there were mixed people there: some were Muslims whom the call of the Messenger of Allah (peace and blessings be upon him) had brought together; among them were idolaters who worshipped idols; among them were Jews; and among them were armed people of the fortresses, who were allies of the two tribes, Aws and Khazraj. As soon as the Messenger of Allah (peace and blessings be upon him) arrived in Madinah, he wanted to make peace and a treaty with all of them. A man would be a Muslim while his father was an idolater, and a man would be a Muslim while his brother was an idolater. The idolaters and Jews of Madinah, at the time the Messenger of Allah (peace and blessings be upon him) arrived, used to cause the Prophet (peace and blessings be upon him) and his (peace and blessings be upon him) Companions severe harm, and Allah commanded His Prophet (peace and blessings be upon him) and the Muslims to be patient with that and to pardon them. It was concerning them that Allah Almighty revealed this verse: "And you will surely hear from those who were given the Scripture before you and from the idolaters much that is hurtful" [Surah Al Imran: 186] up to: "that is of the matters of firm resolve." And concerning them Allah Almighty also revealed this verse: "Many of the People of the Scripture wish they could turn you back into disbelievers after your faith" [Surah al-Baqarah: 109] up to: "until Allah brings His command." When Ka'b bin al-Ashraf refused to desist from harming the Messenger of Allah (peace and blessings be upon him) and the Muslims, the Messenger of Allah (peace and blessings be upon him) ordered Sa'd bin Mu'adh, Muhammad bin Maslamah al-Ansari, then al-Harithi, Abu Isa bin Jabr al-Ansari, and al-Harith (the nephew of Sa'd bin Mu'adh) (may Allah be pleased with them), in a group of five men, to carry out this task. So they came to him one evening at his gathering in al-Awali. When Ka'b bin al-Ashraf saw them, he was suspicious of their business, for he was afraid of them, and he asked them: What has brought you here? They said: A need of ours with you has brought us. He said: Let one of you come close to me and tell me about it. So one of them went close to him and said: We have come to you to sell you our coats of mail, so that we may meet our expenses with their price. He said: By Allah, if you are doing that, then hardship has certainly come upon you ever since this man settled among you. He made an appointment with them to come to him at night, when people had left him. So they came to him, and one of them called out to him. He stood up to go out to them, and his wife said: They have not come to you at this hour for anything you would like. He said: No, they have told me their business. So he went out to them, and Muhammad bin Maslamah (may Allah be pleased with him) embraced him and said to his companions: Do not let him get away from you, even if you kill both me and him. Then one of them struck him in the flank with a sword. When they had killed him, the Jews and the idolaters who were with them were frightened. As soon as morning came, they came to the Prophet (peace and blessings be upon him) and said: Our companion was attacked at night; he was one of our chiefs, and he was killed treacherously. The Messenger of Allah (peace and blessings be upon him) reminded them of what he used to say in his poems and how he used to harm them with it. Then the Messenger of Allah (peace and blessings be upon him) invited them to have a document written between him (peace and blessings be upon him), them and the Muslims in general, containing a comprehensive statement of the people's affairs. So the Messenger of Allah (peace and blessings be upon him) had that document written.
Hadith Referenceالمعجم الكبير للطبراني / باب الكاف / 16204