
Slowly after Mariam understands Ali, she starts getting close to him and on the other hand, even Ali starts to recognize her innocence and unawareness about the world and starts falling for her. Finally after a lot of happenings Ali, Mariam and the five children safely return to Ali's house after escaping from the 40 thieves. After acquiring the second part of the talismaan that Mariam was holding, Simsim and the 40 thieves are on their heist to find the other part of the talismaan that is held by Ali. As the kids get to know the truth they escape from there and are on a run as well searching for Ali, where they started suspecting Nafi due to his general knowledge and skills and as the remaining four didn't know his past. On Zorawar's manipulation Ali's brother Qasim gets ready to oust the kids with his wife so that they can sell their house to Zorawar in exchange of money. Ali rescues Mariam from the slave traders and are on a run on the way to Hairat escaping from the slave traders. Ali and Mariam keep crossing each other and finally meet in the jumma bazar where Mariam loses her second part of the talismaan. Soon Mariam escapes Kabul Shahi and on the way she finds the second part of the talismaan which connects her with Ali. The forty thieves are freed as the meteor created by Simsim crashes the moon and causes a crack on it which breaks Mustafa's curse. Princess Mariam keeps falling in trouble as she was brought up with a lot of care and far away from the real truth of the world due to which she trusts everyone blindly.

Sultan's daughter Mariam, the Princess of Kabul, is rescued by her caretaker Daai Jaan and commander-in-chief Dara Gazi. In Kabul's capital Kabulshahi, Sultan Shah Zuhaid is assassinated by his brother-in-law Saddam who is sidekick of Simsim and wants to be the Sultan of Kabul. Ali who holds one part of the talismaan is completely unaware of the truth and his destiny. The talismaan was divided into two pieces by Mustafa. In present time, Simsim who is a devotee of Iblis and loves him truly has sent a meteor towards the moon so that the 40 thieves are freed who will find the 'talismaan' that has Iblis's life captured in it.

Mustafa in his final moments he makes a prophecy that Ali will become a greater sorcerer than him and protect the citizens of Kabul and write "Dastaan-E-Kabul". He also stops their leader Iblis from fulfilling his evil intentions but is killed by Iblis.

Ali Baba being poor is a very good person at heart who doesn't know about his fate and talent, always receives flashbacks of his childhood in which his father Mustafa a sorcerer who traps all the 40 thieves in a curse that until the moon is secure in the sky they will be trapped in a stone grave.

The story begins with Ali Baba who lives with 5 orphan children Gulrez, Imaad, Poya, Nafi and Alifi in the Mamuli Gali of Kabul.
