Part 4: End of Dynasty
All the 40 thieves' attempts to kill Ali Baba have failed, and the many conspiracies they have hatched against him have instead led to their own destruction. The captain is the only one of them still alive, so he spends the night alone in the forest pondering his future. He decides he’s going to gather another band of bandits and resume his banditry career, as his forefathers had done for generations. Having escaped with his life, he also decides he must end Ali Baba's life; else he would lose all the treasure in the cave, which Ali Baba has access to due to his knowledge of the magic words.
He assumes the alias Khawaja Hassan and opens a shop in the town bazaar, from where he hopes to plot against Ali Baba. He sells some of the finest items from his cave treasure house, and by coincidence, his shop is next to the one that Qassim used to run before his death but is now operated by his son and Ali Baba's nephew, Karim.
Hassan quickly becomes a close friend of most of the traders in the Bazaar. He treats everyone with the utmost respect, but he is especially nice to Qassim's son, a well-dressed young man, with whom he spends a lot of time chatting.
Ali Baba pays a visit to his nephew one day and sits in his shop with him for a long time. The captain recognizes him at first sight, and after he leaves, he asks Karim, "Who is that man?"
"He's my uncle, my father's brother," Karim responds, following which the captain becomes even more interested in him, lavishing him with expensive gifts.
Karim wants to repay Hassan's kindness by hosting him for dinner, but because his house is small, he asks his uncle if he can host him at his house, and Ali Baba says, "No problem, bring him home this Friday. I’ll ask Morgiana to prepare a feast for him."
Accordingly, on Friday, Karim takes Hassan for a walk; and, as they are returning, he leads him to the street where his uncle lives. When they come to the house, he knocks at the gate, saying, “Oh, this is my second home. I have told my uncle much about you and he desires to see you. I shall be grateful if you can come with me.”
Although Hassan Khawaja is excited that he has found a chance to access his enemy’s house and household, and although he hopes he’ll soon attain his end by treachery, he starts making excuses and walking away. However, when Abdullah, the slave-boy, opens the gate, Karim seizes his companion’s hand, and after much persuasion, he leads him in.
Ali Baba lavishes his guest with favor and admiration. "Thank you for being so kind to my brother's son,” he says.
“Your nephew is young but very wise. I find him very resourceful,” replies Hassan.
They have a long, friendly conversation, and as the guest prepares to depart, Ali Baba refuses. “Oh, where are you going. We have prepared a feast for you, so you should join us at the table.”
As Morgiana, the slave-girl spreads the table clothe and lays the dishes to serve her master and his guest, she looks at him and finds out who he is. When she looks even closer, she sees a dagger hidden under his clothes. “This is the oil merchant whose band I destroyed, and he’s looking for another chance to slay my master,” she thinks.
After Hassan has eaten to his fill and been served with dessert, he thinks he has a good opportunity to execute his revenge. “With one thrust of my dagger, I will dispatch this fellow, then I’ll dash across the garden and escape,” he thinks. “I, however, must wait until the slave-boy and the slave-girl have eaten and lain down to sleep in the kitchen.”
Morgiana, however, is watching his every move, and says, “I must not allow this villain to hurt my master.”
She dresses as a dancer, veils her face with fine linen, and asks Abdullah, the slave-boy, to bring the tambourine so that they may entertain their master’s guest. As Abdullah plays the tambourine, Morgiana dances to its tune, moving around the room in calculated, masterful steps that have Ali Baba and his guest clapping in approval.
Finally, she takes the tambourine from Abdulla and bows before Ali Baba, her sword pressed against her breast, at which point Ali Baba tosses a gold coin into the tambourine in appreciation. She then moves in front of Ali Baba's nephew and bows similarly, and he, too, throws a gold coin into the tambourine. As she moves in front of Hassan Khawaja, he picks up his purse, and as he searches for a gold coin to toss into the tambourine, she thrusts the sword into his vitals, causing him to collapse and die instantly.
Ali Baba is enraged and cries out to Morgiana. "Why have you done such a thing?" he wonders.
"Oh, my lord," she exclaims, "I did it not to harm you, but to save you. Loosen his garments and see what he is carrying.” Ali Baba searches the dead man's clothes and discovers a dagger.
"This man is your enemy," Morgiana says. “He is, in fact, the oil merchant and captain of the 40 thieves."
Ali Baba expresses his gratitude to Morgiana and asks his nephew to marry her. "She has saved me many times from that robber's sword; she is a symbol of loyalty and duty," he says.
With all 40 thieves dead, Ali Baba is certain that he is the only one who knows the secret words for opening the cave.