The Prophet ﷺ said, "Whoever swears by a religion other than Islam, lying intentionally, is as he said. And whoever kills himself with a piece of iron will be tormented with it in the fire of Hell."
قال النبي ﷺ: من حلف بملة غير الإسلام كاذبا متعمدا فهو كما قال، ومن قتل نفسه بحديدة عذب به في نار جهنم.
Bukhari narrated it in the Book of Funerals (1363) and in the Book of Tafsir (4843), and Muslim narrated it in the Book of Faith (177:110), both by way of Khalid Haddan, from Abu Qilaba, from Thabit bin Dahhak, who related it. The wording given is that of Bukhari, and Muslim's wording is similar.