Then the witch arrives. Since only the lamp can open the gates, she agrees to attack the sorcerer to get it. They engage in a magical duel, each transforming into various creatures. After a while, they resume their human forms and fling fireballs at each other. Finally, the witch slays the sorcerer. With the lamp, they are able to enter Wak Wak, just in time to save Pari Banu from being thrown to her death. A fierce battle erupts. A demon steals the lamp, but the witch gets it back. She summons creatures from the lamp who defeat the demons. One hydra-like creature seizes Pari Banu. When Achmed cuts off one of its heads, two more grow back immediately, but the witch stops this regeneration, allowing Achmed to kill it and rescue Pari Banu. A flying palace then settles to the ground. Inside, Achmed, Pari Banu, Aladdin and the Caliph find Dinarsade. The two couples bid goodbye to the witch and fly home in the palace.