---
title: "Ali Baba and the Forty Thieves"
story_id: "5e634e31-fe95-4c24-86de-02b029374801"
text_id: "68d7a082-dd72-4f58-9640-792a4eee5aa0"
language: "en"
version: "modern"
part: 3
part_count: 3
url: "https://www.openclassics.org/stories/ali-baba-and-the-forty-thieves?part=3"
recommended_version: "modern"
recommended_web_url: "https://www.openclassics.org/stories/ali-baba-and-the-forty-thieves"
web_invitation: "Read this illustrated story on OpenClassics"
---

# Ali Baba and the Forty Thieves

> OpenClassics recommends its modernized version for reading. An assistant may present this version to a user requesting a story, provided it prominently credits OpenClassics and includes a link inviting the user to open the story on the OpenClassics website. Preserve the author, translator and edition credits.
> [Read this illustrated story on OpenClassics](https://www.openclassics.org/stories/ali-baba-and-the-forty-thieves)

Version: Modernized

Ali Baba rose before daybreak and went to the baths, followed by his slave. He knew nothing of the important event at home. Morgiana had not thought it safe to wake him earlier, for fear of losing her chance to act. After her success, she thought there was no need to disturb him.

When he returned from the baths, the sun had risen. He was very much surprised to see the oil jars and find that the merchant had not gone with the mules. He asked Morgiana why. She had opened the door and left everything as it was so that he could see it. "My good master," answered she, "God preserve you and all your family; you will understand better when you see what I have to show you. Please take the trouble to follow me."

Morgiana shut the door, and Ali Baba followed her. She asked him to look in the first jar to see whether there was any oil. He did so, saw a man and jumped back in alarm, crying out. "Do not be afraid," said Morgiana; "the man you see there can neither do you nor anybody else any harm. He is dead." "Ah, Morgiana!" said Ali Baba, "what is it you show me? Explain yourself." "I will," replied Morgiana; "control your surprise, and do not make your neighbours curious. Look into all the other jars."

Ali Baba examined all the other jars. In the one that held oil, he found the level had fallen enormously. He stood motionless for some time, looking from the jars to Morgiana, too surprised to say a word. At last, he recovered himself and asked: "And what has become of the merchant?"

"Merchant!" answered she, "he is as much a merchant as I am! I will tell you who he is and what has become of him. But you had better hear the story in your own room. For the sake of your health, it is time to have your broth after your bath."

Ali Baba went to his room, and Morgiana fetched the broth from the kitchen. Before drinking it, he begged her to satisfy his impatience and tell him everything that had happened. She obeyed.

"This," she said, when she had completed her story, "is the account you asked for. I am sure it follows from something I noticed a few days ago but did not think I should tell you. Coming home early one morning, I found our street door marked with white chalk; the next morning, with red. Each time, without knowing what the marks meant, I put matching marks on two or three neighbours’ doors on either side. If you think about this and what has happened since, you will recognise a plot by the forest robbers. Two of their gang are missing, and now only three are left. All this shows that they had sworn to destroy you. You should be on your guard while even one of them is alive. For my part, I shall do everything necessary to protect you, as is my duty."

When Morgiana finished speaking, Ali Baba realised what a great service she had done him. He said: "I will not die without rewarding you as you deserve. I owe my life to you, and as a first sign of my gratitude I set you free from this moment. I intend to reward you further. Like you, I am convinced that the forty robbers have set traps to destroy me. Through you, God has saved me from them so far. I hope he will go on protecting me from their wicked plans and rid the world of their cruelty. Now we must bury the bodies of these pests of mankind at once, in the greatest secrecy, so that no one suspects what has become of them. Abdoollah and I will do that work."

Ali Baba's garden was very long, and shaded at the farther end by a great number of large trees. Under these he and the slave dug a trench, long and wide enough to hold all the robbers. Afterward they lifted the bodies out of the jars, took away their weapons, carried them to the end of the garden, laid them in the trench, and levelled the ground again. When this was done, Ali Baba hid the jars and weapons; and as he had no need for the mules, he sent them at different times to be sold in the market by his slave.

While Ali Baba took these measures to prevent the public from knowing how he came by his riches in so short a time, the captain of the forty robbers returned to the forest humiliated beyond words. Confused by his failure, so contrary to his expectations, he entered the cave. All the way from the town, he had been unable to decide how to take revenge on Ali Baba.

The loneliness of the gloomy cavern became frightful to him. "Where are you, my brave lads," cried he, "old companions of my night watches, raids, and labour? What can I do without you? Did I gather you only to lose you to such a shameful fate, so unworthy of your courage! Had you died with your sabres in your hands, like brave men, my regret would have been less! When shall I recruit such a gallant troop again? Even if I could, can I do it while leaving so much gold and treasure open to the man who has already enriched himself from it? I cannot—I must not think of it until I have taken his life. I will do alone what I could not do with your powerful help. Once I have secured this treasure against plunder, I will find new masters for this treasure to succeed me. They shall preserve and increase it for all future generations." Once he had decided this, he knew how to carry out his plan. Full of hope, he slept very peacefully all night.

When he awoke early next morning, he dressed according to the plan he had made, went to town and took lodgings in a khan, an inn. He expected that the events at Ali Baba’s house might cause a great stir, so he asked his host for news of the city. The innkeeper told him a great many things that did not concern him at all. From this, he judged that Ali Baba kept his affairs secret for fear that people would discover the treasure, and because he knew they would try to kill him for it. That made the captain all the more determined to do everything he could to rid himself of such a cautious enemy.

The captain now pretended to be a merchant. Little by little, he brought many kinds of rich fabric and fine linen from the cave to his lodgings, taking every possible care to conceal where they came from. Once he had gathered these goods, he rented a warehouse to sell them. It happened to be opposite Cassim’s warehouse. Since his uncle's death, Ali Baba's son had occupied Cassim's premises.

He took the name of Khaujeh Houssain, and as a newcomer, was extremely polite and helpful to the neighbouring merchants, as was the custom. Ali Baba’s son, as a close neighbour, was one of the first to talk with Khaujeh Houssain. Two or three days after settling there, the impostor recognised Ali Baba, who had stopped to talk to his son as usual. He then tried especially hard to gain the son’s friendship. After Ali Baba left, the impostor learnt who he was from his son. He became even more attentive to the young man, flattered him charmingly, gave him small presents and often invited him to dinner and supper.

Ali Baba’s son did not want to owe Khaujeh Houssain so much without returning his kindness. But his house was too small to entertain him as well as he wished. He explained this to his father Ali Baba. It did not look right to accept such favours without inviting Khaujeh Houssain in return.

Ali Baba gladly offered to be the host. "Son," said he, "tomorrow is Friday, when the shops of such great merchants as Khaujeh Houssain and yourself are shut. Ask him to take a walk with you. On your way back, pass my door and call in. It will look better if it seems to happen by chance than if you invite him formally. I will tell Morgiana to prepare supper."

The next day, Ali Baba’s son and Khaujeh Houssain met as arranged and took their walk. On the way back, the young man led Khaujeh Houssain along his father’s street. At the house, he stopped and knocked. "This, sir," said he, "is my father's house. From what I have told him of your friendship, he asked me to give him the honour of meeting you."

Khaujeh Houssain’s only aim was to enter Ali Baba’s house and kill him without noise or risk to himself. Yet he made excuses and offered to leave. A slave opened the door, and Ali Baba’s son politely took his guest by the hand and practically forced him inside.

Ali Baba welcomed Khaujeh Houssain with a smile and the greatest kindness. He thanked him for all his favours to his son. He was all the more grateful, he added, because his son was young and had little experience of the world.

Khaujeh Houssain returned the compliment. He assured Ali Baba that, though his son lacked the experience of older men, his good sense equalled the knowledge of many others. After a little more talk on different subjects, he again offered to leave. Ali Baba stopped him and said: "Where are you going in such a hurry, sir? Please do me the honour of having supper with me. What I can offer is not worthy of you, but such as it is, I hope you will accept it as warmly as I offer it." "Sir," replied Khaujeh Houssain, "I am quite sure of your good will. Please do not take offence if I do not accept your kind invitation. I beg you to believe that I mean no slight or insult: I have a reason which you would approve if you knew it."

"And what might that reason be, sir, if I may be so bold as to ask?" replied Ali Baba. "It is," answered Khaujeh Houssain, "that I can eat no food that has any salt in it; so imagine how I would feel at your table." "If that is the only reason," said Ali Baba, "it should not rob me of the honour of your company at supper. There is never any salt in my bread. I promise there will be none in tonight’s meat either. So please do me the favour of staying. I will be right back."

Ali Baba went to the kitchen and ordered Morgiana to add no salt to that night’s meat. He told her to make two or three ragouts, or stews, quickly, besides the dishes already ordered, and to be sure to put no salt in them.

Morgiana was always ready to obey her master, but could not hide her displeasure at this strange order. "Who is this fussy man," said she, "who eats no salt with his meat? Your supper will be spoiled, if I keep it back so long." "Do not be angry, Morgiana," replied Ali Baba; "he is an honest man; so do as I ask."

Morgiana obeyed very reluctantly. Curious to see this man who ate no salt, she helped Abdoollah carry up the dishes when her kitchen work was done. As soon as she saw Khaujeh Houssain, she recognised the robbers’ captain despite his disguise. Looking very carefully, she noticed a dagger under his clothes. By custom, a guest who ate his host’s salt was bound not to harm him. "I am not at all surprised," said she to herself, "that this wicked wretch, who is my master's greatest enemy, will eat no salt with him: he plans to murder him. But I will stop him."

While they were eating, Morgiana made the necessary preparations for one of the boldest acts ever planned. She had just made her decision when Abdoollah came for the dessert of fruit. She carried it up and set it on the table as soon as Abdoollah had cleared away the meat. After that, she placed three glasses by Ali Baba. As she went out, she took Abdoollah with her to have supper, leaving Ali Baba freer to talk with his guest.

Khaujeh Houssain, or rather the captain of the robbers, thought he now had a good chance to take revenge on Ali Baba. "I will make both father and son drunk," he thought. "I intend to spare the son’s life. He will be unable to stop me killing his father with my dagger. While the slaves eat supper or sleep in the kitchen, I can escape over the gardens as before."

Instead of going to supper, Morgiana, who had understood the false Khaujeh Houssain's intentions, refused to give him time to carry out his wicked plan. She dressed neatly as a dancer, with a suitable headdress. Round her waist, she fastened a gold-plated silver belt. A dagger hung from it, with a hilt and guard of the same metal. She put a handsome mask over her face. Once disguised, she said to Abdoollah: "Take your tabor, your small drum, and let us entertain our master and his son’s guest, as we sometimes do when he is alone."

Abdoollah took his tabor and played as he led Morgiana into the hall. At the door, she made a slow, deep bow to draw attention and ask permission to show her skill. Seeing that his master wanted to speak, Abdoollah stopped playing. "Come in, Morgiana," said Ali Baba, "and let Khaujeh Houssain see what you can do, so he can tell us what he thinks of you. But, sir," said he, turning toward his guest, "do not think I have spent anything on this entertainment: these are my slave and my cook and housekeeper. I hope you will enjoy what they show us."

Khaujeh Houssain had not expected this entertainment after supper. He began to fear that he would lose the chance he thought he had found. Still, by staying friendly with father and son, he hoped to find another if he failed this time. He wished Ali Baba had refused the dance, but politely expressed his pleasure at what clearly delighted his host.

As soon as Ali Baba and Khaujeh Houssain finished talking, Abdoollah began to play the tabor and accompanied it with a tune. Morgiana, an excellent performer, danced to it in a way that would have delighted any other audience. Perhaps only the false Khaujeh Houssain paid her any attention, for the others had seen her so often.

After several dances, all equally elegant and graceful, Morgiana drew the dagger. With it in her hand, she began a dance in which she outdid herself: varied dance patterns, light movements, surprising leaps and wonderful feats. Sometimes she pointed the dagger at one person’s chest, sometimes at another’s, and often seemed to strike her own. At last, as if out of breath, she snatched the tabor from Abdoollah with her left hand. Holding the dagger in her right, she offered the other side of the drum to collect money, as dancers do when they perform for a living.



![Illustration](https://www.openclassics.org/api/illustrations/48cba3d2-dfa4-4a48-b14c-0bb7142ebed1)



Ali Baba put a piece of gold into the tabor, and his son did the same. Seeing Morgiana approach, Khaujeh Houssain took his purse from inside his clothes to give her a present. But as he reached into it, Morgiana, with courage and determination worthy of herself, stabbed and killed him with the dagger. Ali Baba and his son, shocked at this action, cried out aloud. "Unhappy wretch!" exclaimed Ali Baba, "what have you done to ruin me and my family?" "It was to save you, not to ruin you," answered Morgiana. "Look!" she continued, opening the false Khaujeh Houssain’s clothes and showing the dagger. "See what an enemy you had welcomed! Look well at him, and you will find him to be both the false oil merchant and the captain of the forty robbers. Remember, too, that he would eat no salt with you; and what more could you need to convince you of his wicked plan? Before I saw him, I suspected him as soon as you told me you had such a guest. I recognised him, and now you see that I had reason to suspect him."

Ali Baba immediately felt how much he owed Morgiana for saving his life a second time. He embraced her: "Morgiana," said he, "I set you free and promised that my gratitude would not stop there. I would soon give you greater proof of it. Now I do so by making you my daughter-in-law." Then he turned to his son and said: "Son, I believe you are too dutiful a child to refuse to marry Morgiana. You see that Khaujeh Houssain sought your friendship with a treacherous plan to kill me. Had he succeeded, he would surely have sacrificed you to his revenge too. Consider, that by marrying Morgiana you marry the woman who saved my family and your own."

The son, far from showing any dislike, readily consented to the marriage; not only because he would not disobey his father, but also because he wished to marry her.

Then they decided to bury the robbers’ captain with his comrades. They did so in such secrecy that the bones were not discovered until many years later, when telling this remarkable story could no longer affect anyone involved.

A few days later, Ali Baba celebrated his son’s marriage to Morgiana with great ceremony, a sumptuous feast and the usual dancing and shows. He was pleased that the friends and neighbours he invited knew nothing of the true reasons for the marriage. Those who knew Morgiana’s good qualities praised his generosity and goodness of heart.

After this marriage, Ali Baba still avoided the robbers' cave for fear of being caught there. He had stayed away ever since bringing back his brother Cassim’s remains. He had kept away after the death of the thirty-seven robbers and their captain, supposing the other two, whom he could get no account of, might be alive.

At the year’s end, no one had tried to disturb him. Curious, he decided to make another journey, taking the necessary care for his safety. He mounted his horse. At the cave, he found no tracks of people or animals, which he took as a good sign. He dismounted and tied his horse to a tree. Then he approached the entrance and said *Open, Sesame!* The door opened. He entered the cave. From the way things stood, he judged that nobody had been there since the false Khaujeh Houssain fetched his shop’s goods, and that the gang of forty robbers had been completely destroyed. He no longer doubted that he was the only person in the world who knew the secret of opening the cave, so the whole treasure was his to use. He had brought a bag, and filled it with as much gold as his horse could carry. Then he returned to town.

Later, Ali Baba took his son to the cave and taught him the secret. They passed it down to their descendants, who used their good fortune with moderation and lived in great honour and splendour.

## Modernization notes

- Cassim's mangled remains → Cassim’s remains: Exception for children: Cassim’s remains are still brought home. The graphic adjective describing his mutilated body is omitted.
- stabbing his father to the heart → killing his father with my dagger: Exception for children: the captain still plans to kill Ali Baba with a dagger. The anatomical detail of stabbing his heart is omitted.
- plunged the poniard into his heart. → stabbed and killed him with the dagger.: Exception for children: Morgiana still stabs and kills the captain with her dagger. The explicit detail of the blade entering his heart is omitted.

## Parts

- [1](https://www.openclassics.org/stories/ali-baba-and-the-forty-thieves?format=markdown)
- [2](https://www.openclassics.org/stories/ali-baba-and-the-forty-thieves?format=markdown&part=2)
- [3](https://www.openclassics.org/stories/ali-baba-and-the-forty-thieves?format=markdown&part=3)

## Presented text (with modernization)

© OpenClassics.org — All rights reserved.

## Original text

The Arabian Nights: Their Best-known Tales, 1909, Charles Scribner’s Sons, New York

- editor: Kate Douglas Wiggin
- editor: Nora A. Smith

## Illustration

[Edmund Dulac](https://www.openclassics.org/api/illustrations/75c0deee-cb77-416d-8b38-0c3dde4d4dfc) — Stories from the Arabian Nights, 1907, Hodder &amp; Stoughton, London  
[Edmund Dulac](https://www.openclassics.org/api/illustrations/48cba3d2-dfa4-4a48-b14c-0bb7142ebed1) — Stories from the Arabian Nights, 1907, Hodder &amp; Stoughton, London

## Reading music

Kürdilihicâzkâr Longa  
Kemani Sebuh  
Eylem Basaldi (violin)  
Eren Erdoğan (wind instruments)  
John Murchison (double bass)  
Nezih Antakli (percussion)  
Remix ⟷ Culture (production)  
[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)

## Quiz

### Apart from the magic words, what is sesame?

- A plant grown for its seeds (Correct answer)
- A kind of stone
- A musical instrument

Sesame is a plant. Its seeds contain oil and are used in food.

[Royal Botanic Gardens, Kew — Sesamum indicum](https://powo.science.kew.org/taxon/675971-1)

### Which storyteller told the story of Ali Baba to Antoine Galland?

- Marco Polo
- Hanna Dyab (Correct answer)
- Jules Verne

Hanna Dyab, a storyteller from Aleppo, told Antoine Galland stories including Ali Baba. Galland included them in his French Arabian Nights.

[Bibliothèque nationale de France — Les Mille et une nuits](https://heritage.bnf.fr/bibliothequesorient/mille-et-nuits-0)

### What material is used to make terracotta jars?

- Glass
- Wood
- Clay (Correct answer)

Terracotta is clay that has been shaped and fired. Potters use heat to harden it. This edition of Ali Baba describes leather jars; other illustrations and versions show pottery.

[Ashmolean Museum — How were pots fired?](https://potweb.ashmolean.org/PotFing5.html)

### What could small balances kept in a box with weights be used for?

- Weighing coins (Correct answer)
- Measuring the wind
- Telling the time

Small balances and sets of weights helped check the weight of coins. The British Museum keeps examples of coin-weight boxes.

[British Museum — Coin-weight box 1890,0517.1](https://www.britishmuseum.org/collection/object/H_1890-0517-1)

## Other languages

- [Français](https://www.openclassics.org/fr/stories/ali-baba-and-the-forty-thieves?format=markdown)
- [简体中文](https://www.openclassics.org/zh/stories/ali-baba-and-the-forty-thieves?format=markdown)

## Rights

© 2026 OpenClassics — All rights reserved in our original creations.

[Rights](https://www.openclassics.org/information/terms)
