The chief lost all his men, but he did not change his plan to kill Ali Baba. He disguised himself as a merchant. He brought rich silk and fine linen from the cave, and set up a shop opposite that of Ali Baba's son. He called himself Cogia Hassan. He soon made friends with Ali Baba's son and often invited him and Ali Baba to dinner.
One day Ali Baba invited Cogia Hassan into his house and thanked him for his kindness to his son.
Morgiana wanted to look at the guest, so she helped her fellow slave carry the dishes. As soon as she saw Cogia Hassan, she knew that he was the chief of the thieves and that he carried a dagger under his coat.
She decided to save her master and his son from the bad man. She thought of a very bold idea.
After dinner Morgiana dressed herself as a dancing girl and hid a dagger in her girdle.
"Come in, Morgiana," said Ali Baba. "Let Cogia Hassan see what you can do."
The chief was not pleased. He was afraid he might miss the chance of killing Ali Baba, but he pretended to be enjoying her dances. Morgiana began another dance. She drew her dagger and danced with it in her hand.
After several dances Ali Baba and his son gave her a piece of gold. Cogia Hassan pulled out his purse to give her a present, but while he was putting his hand into it, she plunged her dagger into his heart.
"Have you gone mad? What a terrible thing you have done!" cried Ali Baba and his son.
"It was to save you. Look well at him," she cried. "He is the chief of the forty thieves! I have killed him for you and your son." And she opened the merchant's coat and showed the dagger.
Ali Baba wanted to thank her and asked his son to marry her. He was glad to take her for his wife. A few days later, their wedding was held with great splendor.
One year passed by. Ali Baba heard nothing of the remaining thieves. He thought that they were dead, so he started for the cave. He opened the door by saying, "Open, Sesame!" He went in and took away as much gold as he could and returned to town.
He told his son the secret of the cave. They always had the hidden cave to keep them rich to the end of their days.
强盗首领失去了他全部的手下,但并未改变杀死阿里巴巴的计划。他将自己装扮成商人。他从山洞里拿了上好的丝织品和亚麻布,在阿里巴巴儿子的商店对面开了一家商店。他自称是柯加‧哈珊。不久他就和阿里巴巴的儿子交上朋友,并经常邀请他和阿里巴巴去吃晚餐。
有一天阿里巴巴邀请柯加‧哈珊到他家去,感谢他那幺善待他的儿子。
玛琪安娜想要看看这位客人是什幺模样,便帮助她以前曾共事的仆人上菜。她一看到柯加‧哈珊,便认出他就是强盗首领,也发现他在上衣内还藏了把匕首。
她决定拯救她的主人及其儿子免受坏人之害。她想到一个非常大胆的办法。
晚餐后,她将自己扮成舞者,并在束腰间藏了一把匕首。
阿里巴巴说:『进来吧,玛琪安娜,让柯加‧哈珊欣赏你的表演。』
强盗首领并不高兴。他害怕会错失杀死阿里巴巴的机会,但还是假装很欣赏她的舞蹈。玛琪安娜开始跳另一段舞。她掏出匕首拿在手上舞着。
跳了几段舞后,阿里巴巴和他儿子赏给玛琪安娜一块金子。柯加‧哈珊掏出钱包要赏她礼物,但就在他伸手进去时,玛琪安娜把匕首刺入他的心脏。
阿里巴巴和他儿子大叫:『你疯了不成?看你做了多幺可怕的一件事!』
她叫道:『我这样做是在救你们。仔细看看他。他正是四十大盗的首领!我是为了你和令郎才杀他的。』她掀开这名商人的上衣,露出匕首来。
阿里巴巴很感激她,并叫他儿子娶她为妻。阿里巴巴的儿子非常高兴能娶她做太太。几天后,他们便举行了一个盛大的婚礼。
一年过去了。阿里巴巴并没听到任何有关那些强盗余党的消息。他认为他们都已经死了,所以便动身前往那个山洞。他说:『芝麻,开门!』门就开了。他进入山洞带走了大量的金子回到镇上。
他把山洞的秘密告诉他的儿子。往后一辈子他们就靠着那隐密的山洞过着富裕的生活。