The Ruling on Prayer behind an Imam Who performs Sleight of Hand Tricks
Question :
It has been discovered that the Imam who leads us in prayer in our village mosque uses talismans and practices sleight of hand tricks. Am I guilty of any sin in praying behind him?
Answer:
Essentially in this matter, we have to say that every person from among the Muslims whose prayer is correct is allowed to act as Imam, especially if the people are ignorant of the situation of the Imam. As for those whose prayers are not accepted, such as the people of innovation, whose innovations reach to the level of disbelief, prayer behind them is not accepted, because their prayer is not accepted. And regarding this man who practises sleight of hand tricks, and uses talismans, we say: He is practising two things - the use of talismans and sleight of hand. As for the latter, it is forbidden without any doubt, because of the cheating which it entails, and it might even include that which takes it to the level of disbelief, such as when they employ the devils and draw close to them by sacrificing to them and supplicating them and the like. As for the talismans, if they are from the Qur'an or lawful supplications, the scholars have disagreed regarding it. Some of them have permitted it, while others have forbidden it, but it is not despised to pray behind an Imam who uses them. However, if the talismans are polytheistic, innovatory incantations, then it is not permissible to use them, by unanimous agreement; and that person must turn to Allah, the Most High in repentance from what he has done and abstain from doing it again.
Source:
Ibn 'uthaymin
Fatawa Islamiyah, Vol. 2 Pages 218