Sonapur is a small village in modern day India that is being terrorized by a bandit named Zakali and his gang of 40 thieves. The villagers, young and old, even the Police, are all terrified. When a new Forest Officer is appointed, the villagers become bold, but Zakali soon forces them to change their minds and kills several people. Then an outcast village woodcutter, Alibaba, comes across Zakali's cave, which is located near Kali Pahadi, a valley that is still inhabited by prehistoric dinosaurs, uses the magic words 'Khul Ja Sim Sim', and finds untold wealth in it. He decides to take some and distribute it amongst the poor villagers. Razia, his estranged brother, Qasim's wife, finds out and compels Alibaba to tell her husband the location of the cave. Qasim goes there, grabs as much as he can hold, but is unable to remember the magic words to exit the cave. Shortly thereafter Zakali returns, slices Qasim's body in half and leaves. Alibaba finds his brother's mutilated body, and he and his sweetheart, Marjina, secretly hire a cobbler, Mushtaq Mochee, to sew it together and make it ready for burial, which he does for a fat fee. When Zakali finds Qasim's body missing, he decides to attack Sonapur but is ambushed and many of his men are killed. Zakali then plans to deceive Alibaba, get his wealth back and kill him - and there is no power on Earth that can stop Zakali.