Ali Baba and the Forty Thieves

By Anonymous (Arabian Nights)18 min readFairy tale
Ali Baba and the Forty Thieves

IN a town in Persia lived two brothers, one named Cassim, the other Ali Baba. Cassim was married to a rich wife and lived in plenty, while Ali Baba had to maintain his wife and children by cutting wood in a neighbouring forest and selling it in the town.

One day, when Ali Baba was in the forest, he saw a troop of men on horseback, coming towards him in a cloud of dust. He was afraid they were robbers, and climbed into a tree for safety. When they came up to him and dismounted, he counted forty of them. They unbridled their horses and tied them to trees. The finest man among them, whom Ali Baba took to be their captain, went a little way among some bushes, and said, “Open, Sesame!” so plainly that Ali Baba heard him. A door opened in the rock; and having made the troop go in, he followed them, and the door shut again of itself.

They stayed some time inside, and Ali Baba, fearing they might come out and catch him, sat patiently in the tree. At last the door opened again, and the Forty Thieves came out. As the Captain went in last, he came out first, and made them all pass by him; he then closed the door, saying, “Shut, Sesame!” Every man bridled his horse and mounted, the Captain put himself at their head, and they returned as they came.

Then Ali Baba climbed down, and went to the door concealed among the bushes, and said, “Open, Sesame!” and it flew open. Ali Baba, who expected a dull, dismal place, was greatly surprised to find it large and well lighted, and hollowed by the hand of man, in the form of a vault, which received the light from an opening in the ceiling. He saw rich bales of merchandise—silk, stuff-brocades, all piled together, and gold and silver in heaps, and money in leather purses. He went in and the door shut behind him. He did not look at the silver, but brought out as many bags of gold coin as he thought his asses, which were three, could carry, loaded them on the beasts, and covered them with faggots of wood. Using the words “Shut, Sesame!” he closed the door and went home.

Then he drove his asses into the yard, shut the gates, carried the gold bags to his wife, and emptied them before her. She, finding they were all gold, was afraid some one had been robbing; but Ali Baba told her the story. Then she wanted to count the gold; but he said, “Wife, you do not know what you undertake, when you would count the pieces; we must dig a hole and bury them.” She, however, resolved to measure it; and running to the wife of Cassim, she borrowed a measure. Cassim’s wife, knowing Ali Baba’s poverty, was curious, and slyly rubbed the bottom of the measure with suet. Ali Baba’s wife went home, and filled the measure again and again, till she had measured all the gold, which Ali Baba buried. She then carried back the measure, but without observing a piece of gold that stuck to the bottom.

“Fine doings, indeed!” said Cassim’s wife to her husband, when she saw the gold; “your brother Ali Baba, who pretends to be so poor, is richer than you, for he does not count his money, but measures it.” Cassim, hearing this, grew so envious, that he could not sleep, and went to his brother in the morning. “Ali Baba,” said he, “tell me how you came by the gold you measured yesterday.” Ali Baba told him the story of the robbers, and the secret of the cave, and offered him part of the treasure; but the envious Cassim resolved to have it all. He rose early next morning, and set out with ten mules loaded with great chests. He found the rock easily, and having said, “Open, Sesame!” gained admission, where he found even more riches than Ali Baba had described. He gathered together as much of the gold coin as he could possibly carry away; but when he was ready to depart, he could not recollect the words to make the door open, but said, “Open, Barley!” and the door remained fast. He named several sorts of grain, but still the door kept shut. Cassim, who had never expected such an incident, became the most miserable of men. He threw down the gold, and walked about the cave, lamenting his fate; but, alas! fear had made him forget the word.

The robbers returned at night, and found Cassim in the cave, and the gold he had thrown about. They instantly put him to death, hung up his body in the cave, and left it there, to terrify any who might chance to discover their retreat.

When Cassim’s wife saw night come on, and her husband not returned, she became greatly alarmed; she watched at her window till day-break, and then went to Ali Baba, to tell him her fears. Ali Baba, who had suspected what might happen, went instantly to the forest, and found the door of the cavern, saying, “Open, Sesame!” He went in, and saw the dead body of his brother hung up. He took it down, and loading one of his asses with it, laid wood over it, and loading the other two asses with bags of gold, covered them also with wood, and closing the door, came away. He drove the two asses laden with gold into his own yard, and led the other to the house of his brother. He knocked at the door, which was opened by Morgiana, a clever, intelligent slave, whom his brother had purchased. Ali Baba delivered the body to Morgiana, and went home to tell the sad news to his wife.

Morgiana, having washed the body, hastened to the shop of an old cobbler, whom she knew to be always early at his stall; and putting a piece of gold into his hand, bade him follow her with his needle and thread. Mustapha, the cobbler, was a merry old man, who, seeing the gold, said, “I am ready, I will follow you to the world’s end.” Morgiana then told him he must suffer himself to be blindfolded: when Morgiana, carefully covering his eyes, so that he could not see a step of the way, led him to Cassim’s house; and taking him to the room where the body was lying, removed the bandage from his eyes, and bade him sew the mangled limbs together.

Mustapha obeyed her orders; and having received two pieces of gold, was led blindfolded the same way back to his stall.


Morgiana, then covering the body with a winding sheet, sent for the undertaker to make preparations for the funeral; and Cassim was buried with all due solemnity that very day.

Ali Baba now removed his few goods and all his gold coin that he had brought from the cavern, to the house of his deceased brother, of which he took possession; and Cassim’s widow received every kind attention both from Ali Baba and his wife.

After an interval of some months, the troop of robbers again visited their retreat in the forest, and were completely astonished to find the body taken away from the cave, and every thing else remaining in its usual order. “We are discovered," said the captain, “and shall certainly be undone if we do not adopt speedy measures to prevent our ruin. Which of you, my brave comrades, will undertake to search out the villain who is in possession of our secret?”

One of the boldest of the troop advanced, and offered himself, and was accepted on the following conditions; namely, that if he succeeded in his enterprise, he was to be made second in command of the troop; but that if he brought false intelligence, he was immediately to be put to death.

The bold robber readily agreed to the conditions; and having disguised himself, he proceeded to the city. He arrived there about day-break, and found the cobbler Mustapha in his stall, which was always open before any shop in the town.

“Good morrow, friend”, said the robber, as he passed the stall, “you rise betimes: I should think, old as you are, you could scarcely see to work by this light.”

“Indeed, Sir,” replied the cobbler, “old as I am I do not want for good eye-sight as you must needs believe, when I tell you I sewed a dead body together the other day, where I had not so good a light as I have now.”

“A dead body!” exclaimed the robber; he had luckily met with the very man who could give him the information he was in search of. However he did not wish to make me believe that the people of your city do impossible things.”

“I tell you,” said Mustapha in a loud and angry tone, “I sewed a dead body together with my own hands.”

“Then I suppose you can tell me also where you performed this wonderful business?”


Upon this, Mustapha related every particular of his being led blindfold to the house, &c.

“Well, my friend,” said the robber, “’tis a fine story, I confess, but not very easy to believe: however, if you will convince me by shewing me the house you talk of, I will give you four pieces of gold to make amends for my unbelief.”

“I think,” said the cobler, after considering awhile, “that if you were to blindfold me, I should remember every turning we made; but with my eyes open I am sure I should never find it.”

Accordingly the robber covered Mustapha’s eyes with his handkerchief, who led him through most of the principal streets, and stopping by Cassim's door, said, “here it is, I went no further than this house.”

The robber immediately marked the door with a piece of chalk; and giving Mustapha his four pieces of gold, dismissed him.

Shortly after the thief and Mustapha had quitted the door, Morgiana coming home from market, perceived the little mark of white chalk on the door; and suspecting something was wrong, directly marked four doors on one side and five on the other of her master’s, in exactly the same manner, without saying a word to any one.

The robber meantime rejoined his troop, and boasted greatly of his success. His captain and comrades praised his diligence; and being well armed, they proceeded to the town in different disguises and in separate parties of three and four together.

It was agreed among them, that they were to meet in the market place at the dusk of evening; and that the captain and the robber, who had discovered the house, were to go there first, to find out to whom it belonged. Accordingly, being arrived in the street, and having a lantern with them, they began to examine the doors, and found, to their confusion and astonishment, that ten doors were marked exactly alike. The robber, who was the captain’s guide, could net say one word in explanation of this mystery; and when the disappointed troop got back to the forest, his enraged companions ordered him to be put to death.

Another now offered himself upon the same conditions as the former; and having bribed Mustapha, and discovered the house he made a mark with dark red chalk upon the door, in a part that was not in the least conspicuous: and carefully examined the surrounding doors, to be certain that no such mark was upon any one of them.

But nothing could escape the prying eyes of Morgiana: scarcely had the robber departed when she discovered the red mark: and getting some red chalk, she marked seven doors on each side precisely in the same place and in the same manner.


The robber, valuing himself highly upon the precautions he had taken triumphantly conducted his captain to the spot: but great indeed was his confusion and dismay, when he found it impossible to say which, among fifteen houses marked exactly alike, was the right one. The captain, furious with his disappointment, returned again with the troop to the forest; and the second robber was also condemned to death.

The captain having thus lost 2 of his troop, judged that their hands were more active than their heads in such services; and he resolved to employ no other of them, but to go himself upon the business.

Accordingly he repaired to the city, and addressed himself to the cobler Mustapha; who for six pieces of gold readily performed the same services for him he had done for the two other strangers, and the captain much wiser than his men, did not amuse himself with setting a mark upon the door, but attentively considered the house, counted the number of its windows, and passed by it very often to be certain that he should know it again.

He then returned to the forest and ordered his troop to go into the town, and buy nineteen mules and thirty-eight large jars, one full of oil, and the rest empty.

In two or three days the jars were bought, and all things in readiness, and the captain having put a man into each jar properly armed, the jars being rubbed on the outside with oil, and the covers having holes bored in them for the men to breathe through, loaded his mules, and in the habit of an oil-merchant, entered the town in the dusk of the evening. He proceeded to the street where Ala Baba dwelt, and found him sitting in the porch of his house. “Sir,” said he to Ali Baba, “I have brought this oil a great way to sell, and am too late for this day's market, as I am quite a stranger in this town, will you do me the favour to let me put my mules into your court-yard, and direct me where I may lodge to night?”

Ali Baba, who was a good-natured man, welcomed the pretended oil-merchant very kindly, and offered him a bed in his own house; and having ordered the mules to be unloaded in the yard, and properly fed, he invited his guest into supper. The captain, having seen the jars placed ready in the yard, followed Ali Baba into the house, and after supper, was shown to the chamber where he was to sleep.

It happened that Morgiana was obliged to sit up later that night than usual, to get ready her master’s bathing linen for the following morning; and while she was busy about the fire, her lamp went out, and there was no more oil in the house.

After considering what she could possibly do for a light she recollected the thirty-eight oil jars in the yard, and determined to take a little oil out of one of them for her lamp. She took her oil-pot in her hand and approaching the first jar, the robber within said, “Is it time, captain?” Any other slave, perhaps, on hearing a man in an oil-jar, would have screamed out; but the prudent Morgiana instantly recollected herself, and replied softly, “No, not yet; lie still till I call you.” She passed on to every jar, receiving the same question, and making the same answer, till she came to the last, which was really filled with oil.

Morgiana was now convinced that this was a plot of the robbers to murder her master Ali Baba; so she ran back to the kitchen, and brought out a large kettle, which she filled with oil, and set it on a great wood fire; and as soon as it boiled, she went and poured into the jars sufficient of the boiling oil to kill every man within them.

Having done this, she put out her fire, and her lamp, and crept softly to her chamber.


The captain of the robbers, hearing every thing quiet in the house, and perceiving no light any where, arose and went down into the yard to assemble his men. Coming to the first jar, he felt the steams of the boiled oil; he ran hastily to the rest, and found every one of his troop put to death in the same manner. Full of rage and despair at having failed in his design, he forced the lock of a door that led to the garden, and made his escape over the walls.

On the following morning, Morgiana related to her master Ali Baba his wonderful deliverance from the pretended oil merchant and his gang of robbers. Ali Baba at first could scarcely credit her tale; but when he saw the robbers dead in the jars, he could not sufficiently praise her courage and sagacity; and without letting any one else into the secret, he and Morgiana, the next night, buried the thirty-seven thieves in a deep trench at the bottom of the garden. The jars and the mules as he had no use for them, were sent from to time to the different markets, and sold.

While Ali Baba took these measures to prevent his and Cassim's adventures in the forest from being known, the captain returned to his cave, and for some time abandoned himself to grief and despair. At length however he determined to adopt a new scheme for the destruction of Ali Baba. He removed by degrees all the valuable merchandise from the cave to the city, and took a shop exactly opposite to Ali Baba's house.

He furnished this shop with every thing that was rare and costly, and went by the name of the merchant Cogio Hassan. Many persons made acquaintance with the stranger, and among others, Ali Baba's son went every day to his shop. The pretended Cogia Hassan soon appeared to be very fond of Ali Baba's son, offered him many presents, and often detained him to dinner, on which occasions he treated him in the handsomest manner.

Ali Baba’s son thought it was necessary to make some return to these civilities, and pressed his father to invite Cogia Hassan to supper. Ali Baba made no objection, and the invitation was accordingly given.

The artful Cogia Hassan would not too hastily accept this invitation, but pretended he was not fond of going into company, and that he had business which demanded his presence at home. These excuses only made Ali Baba's son the more eager to take him to his father’s house: and after repeated solicitations, the merchant consented to sup at Ali Baba’s the next evening.

A most excellent supper was provided, which Morgiana cooked in the best manner, and, as was her usual custom, she carried in the first dish herself. The moment she looked at Cogia Hassan, she knew him to be the pretended oil-merchant. The prudent Morgiana did not say a word to any one of this discovery, but sent the other slave into the kitchen, and waited at table herself; and while Cogia Hassan was drinking, she perceived he had a dagger laid under his coat. When supper was ended, and the desert and wine on the table, Morgiana went away and dressed herself in the habit of a dancing girl: she next called Abdalla, a fellow slave, to play on his taber while she danced.

As soon as she appeared at the parlour door, her master, who was very fond of seeing her dance, ordered her to come in to entertain his guest with some of her best dancing. Cogia Hassan was not very well satisfied with this entertainment, yet was compelled, for fear of discovering himself, to seem pleased with the dancing, while in fact he wished Morgiana a great way off, and was quite alarmed, lest he should lose his opportunity of murdering Ali Baba and his son.

Morgiana danced several dances with the utmost grace and agility; and then drawing a poinard from her girdle, she performed many surprising things with it, sometimes presenting the point to one and sometimes to another and then seemed to strike it into her own bosom. Suddenly she paused and holding the poinard in the right hand, presented her left to her master as if begging some money; upon which Ali Baba and his son each gave her a small piece of money. She then turned to the pretended Cogia Hassan, and while he was putting his hand into his purse, she plunged the poinard into his heart.

“Wretch!” cried Ali Baba, “thou hast ruined me and my family.”


“No, Sir,” replied Morgiana, “I have preserved, and not ruined, you and your son. Look well at this traitor and you will find him to be the pretended oil-merchant who came once before to rob and murder you.”

Ali Baba, having pulled off the turban and the clock which the false Cogia Hassan wore, discovered that he was not only the pretended oil-merchant, but the captain of the forty robbers, who had slain his brother Cassim; nor could he doubt that his perfidious aim had been to destroy him, and probably his son, with the concealed dagger. Ali Baba, who felt the new obligation he owed to Morgiana for thus saving his life a second time, embraced her, and said, “My dear Morgiana, I give you your liberty; but my gratitude must not stop there; I will also marry you to my son who can esteem and admire you no less than does his father.” Then turning to his son he added, “You, my son, will not refuse the wife I offer; for, in marrying Morgiana, you take to wife the preserver and benefactor of yourself and family.”

The son, far from shewing any dislike, readily and joyfully accepted his proposed bride, having long entertained an affection for the good slave Morgiana.

Having rejoiced in their deliverace, they buried the captain that night with great privacy, in the trench, along with his troop of robbers; and a few days afterwards Ali Baba celebrated the marriage of his son and Morgiana with a sumptuous entertainment; and every one who knew Morgiana, said she was worthy of her good fortune, and highly commended her master’s generosity toward her.

During a twelvemonth Ali Baba forbore to go near the forest, but at length his curiosity incited him to make another journey. When he came to the cave, he saw no footsteps of either men or horses; and having said, Open, Sesame, he went in, and judged by the state of things deposited in the cavern, that no one had been there since the pretended Cogia Hassan had removed the merchandise to his shop in the city. Ali Baba took as much gold home as his horse could carry; and afterwards he carried his son to the cave, and taught him the secret. The secret they handed down to their posterity; and using their good fortune with moderation, they lived in honour and splendour, and served with dignity some of the highest offices of the city.

Related Stories

18 min left • 0% read