An Indian magician came to the court of Mutawakkil and astonished the audience through his tricks. Mutawakkil thought it would be a good idea to degrade Imam Ali Naqi (a.s.) through him. So he summoned the Imam and made the magician sit besides the Imam as he had requested. After some time, dinner was served. As soon as the Imam wanted to take up the loaf of bread, he made it fly away. Imam (a.s.) remained patient and the courtiers started laughing and the same thing was repeated. So much so that after three chances, Imam (a.s.) gestured to the lion of the carpet and he became alive and devoured the magician. There was chaos in the court and Mutawakkil became senseless; he asked Imam (a.s.) to return the magician from the lion of the carpet. Imam (a.s.) asked: Had the staff of Musa returned the magicians? Saying this he left the court.
Shawahidun Nubuwwah, Pg. 209;
Damatus Sakiba, Vol. 3, Pg, 145
Imam (a.s) was able to do this because this is the Wilayat(Mastership) given by Allah the Almighty(s.w.t) to Imams of Aale Mohammad(a.s).
They have an authority over the whole creation/mankind.
Therefore we can quote here the narration from Imam Mohammad al-Baqir(a.s)
“Our Wilayat is the Wilayat of Almighty Allah and no Prophet was sent except for it”
Reference : Basair ad-darajaat, pg.75