From the book Messenger of Allah: Ash-Shifa of Qadi Iyad, written by revered ancient Sunni Islamic scholar Imam Qadi Iyad, section titled Part Four : The judgments concerning those who think the Prophet imperfect or curse him, Section Two: The proof of the necessity of killing anyone who curses the Prophet or finds fault with him.
We have already mentioned the consensus. As for the traditions, al-Husayn ibn ‘Ali related from his father that the Messenger of Allah said in respect to this matter, “Whoever curses a Prophet, kill him. Whoever curses my Companions, Beat him.”
In a sound hadith the Prophet commanded that Ka’b ibn al-Ashraf be killed. He asked, “Who will deal with Ka’b ibn Al-Ashraf? He has harmed Allah and His Messenger.” He sent someone to assassinate him without calling him to Islam, in distinction to idol-worshipers. The cause of that lay in his causing harm to the Prophet. That indicates that the Prophet had him killed for something other than idol-worship. It was for causing Harm. Abu Rafi,’ who used to harm the Messenger of Allah and work against him, was also killed.
Similarly on the Day of the Conquest, he ordered the killing of Ibn Khatal and his two slavegirls who used to sing curses on the Prophet.
In another hadith about a man who used to curse the Prophet, the Prophet said, “Who will save me from my enemy?” Khalid said, “I will,” so the Prophet sent him out and he killed him.
Similarly the Prophet commanded that a group of unbelievers who used to injure and curse him, like an-Nadr ibn al-Harith and ‘Uqba ibn Abi Mu’ayt, be killed. He promised that a group of them would be killed before and after the conquest. They were all killed except for those who hurried to become Muslim before they were overpowered. Al-Bzaar related from Ibn ‘Abbas that ‘Uqba ibn Abi Mu’ayt cried out, “O company of Quraysh, why is it that I alone among you am to be killed without war?” The Prophet said, “For your disbelief and your forging lies against the Messenger of Allah.”
‘Abdu’r-Razzaq mentioned that a man cursed the Prophet, causing the Prophet to say, “Who will save me from my enemy”? Az-Zubayr said, “I will.” He sent az-Zubayr and he killed him.
It is related that a woman used to curse the Prophet and he said, “Who will save me from my enemy?” Khalid ibn al-Walid went out and killed her.
Quran 9:29 reads,
“Fight against those who (1) believe not in Allah, (2) nor in the Last Day, (3) nor forbid that which has been forbidden by Allah and His Messenger (4) and those who acknowledge not the religion of truth (i.e. Islam) among the people of the Scripture (Jews and Christians), until they pay the Jizya with willing submission, and feel themselves subdued.”
And Quran 9:33,
“It is He Who has sent His Messenger (Muhammad) with guidance and the religion of truth (Islam), to make it superior over all religions even though the Mushrikun (polytheists, pagans, idolaters, disbelievers in the Oneness of Allah) hate (it).”