The scholars have mentioned that the Momin Jinns used to kill the disbeliever Jinns who used to abuse the Mohammad صلی اللہ علیہ وسلم, this happened before the Hijrah and when the revelation of killing of Jinns and Humans were not revealed, Mohammad صلی اللہ علیہ وسلم used to support and thanks to those who do this.
Saad bin yahya narrated in his Maghazi with the chain of Mohammad bin saeed that he heard from Munkadir that ibn Abbas رضیﷲ عنه said:
A jinn climbed Mount Abu Qabees and recited a few verses of the poem and it got spread in Makkah.
The Mohammad صلی اللہ علیہ وسلم said:
هذا شيطان يكلم الناس من الأوثان يقال له مسعر والله مخزيه"
It is the devil who has recited these verses about idols. His name is Mas'ar. May Allah humiliate him. Just three days had passed when someone on this mountain was reciting this poem:
نحن قتلنا في ثلاث مسعرا سفه الحق وسن المنكرا
قنعته سيفا حساما مبترا بشتمه نبيا المطهرا
We have killed Mas'aar in three days, He despised the Haqq and cast it with evil and I have shaded him with sharp razor because he used to abuse our beloved Rasool صلی اللہ علیہ وسلم
Then Rasool صلی اللہ علیہ وسلم said
هذا عفريت من الجن اسمه سمحج آمن بي سميته عبد الله أخبرني أنه في طلبه منذ ثلاثة أيام فقال علي: جزاه الله خيرا يا رسول الله.
This was a rebellious jinn whose name was Sam'haj, I named him Abdullah. He told me that I have been looking for that poet for three days. Hazrat Ali رضیﷲ عنه said: Ya Rasool صلی اللہ علیہ وسلم, May Allah reward him with goodness.
-(As Saarim Al Maslool ala Shatim ur Rasool pg.150-151) By Ibn Taymiyah رحمہ اللہ