Sayyiduna Ma'qil bin Yasar (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "Two kinds of people from my Ummah will not attain my intercession: an oppressive, tyrannical ruler, and one who goes to extremes in the religion, who bears witness against (the Muslims) and then disowns them."
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 17629