Abu Hurairah reported,

The Prophet ﷺ said, "An ifrit from among the jinn broke loose last night trying to interrupt my prayer, but Allah gave me power over him, so I seized him. I meant to tie him to one of the pillars of the masjid so that all of you could look at him, but then I remembered the supplication of my brother Sulayman, 'My Lord, grant me a kingdom such as shall not belong to anyone after me' [Sad 38:35], so I sent him away humiliated."Ifrit means one who is rebellious, whether from mankind or the jinn, like zibniya, whose plural is zabaniya.

Bukhari 3423

Sahih

حدثني محمد بن بشار حدثنا محمد بن جعفر حدثنا شعبة عن محمد بن زياد

عن أبي هريرة

عن النبي ﷺ إن عفريتا من الجن تفلت البارحة ليقطع علي صلاتي فأمكنني الله منه فأخذته فأردت أن أربطه على سارية من سواري المسجد حتى تنظروا إليه كلكم فذكرت دعوة أخي سليمان رب {هب لي ملكا لا ينبغي لأحد من بعدي} فرددته خاسئا {عفريت} متمرد من إنس أو جان مثل زبنية جماعتها الزبانية

البخاري 3423صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Hadiths of the prophets
Chapter
Saying of Allah the Exalted, "And We gave to Dawud, Sulayman, an excellent servant. Indeed, he was one repeatedly turning back to Allah"
Numbering
Darussalam 3423
Bukhari 3423