The robber was overjoyed at his good fortune, and, giving him a piece of gold, desired to be shown the house where he stitched up the dead body. At first Mustapha refused, saying that he had been blindfolded; but when the robber gave him another piece of gold he began to think he might remember the turnings if blindfolded as before. This means succeeded; the robber partly led him, and was partly guided by him, right in front of Cassim's house, the door of which the robber marked with a piece of chalk. Then, well pleased, he bade farewell to Baba Mustapha and returned to the forest. By and by Morgiana, going out, saw the mark the robber had made, quickly guessed that some mischief was brewing, and fetching a piece of chalk marked two or three doors on each side, without saying anything to her master or mistress.

The thief, meantime, told his comrades of his discovery. The Captain thanked him, and bade him show him the house he had marked. But when they came to it they saw that five or six of the houses were chalked in the same manner. The guide was so confounded that he knew not what answer to make, and when they returned he was at once beheaded for having failed.

Another robber was dispatched, and, having won over Baba Mustapha, marked the house in red chalk; but Morgiana being again too clever for them, the second messenger was put to death also.

The Captain now resolved to go himself, but, wiser than the others, he did not mark the house, but looked at it so closely that he could not fail to remember it. He returned, and ordered his men to go into the neighboring villages and buy nineteen mules, and thirty-eight leather jars, all empty except one, which was full of oil. The Captain put one of his men, fully armed, into each, rubbing the outside of the jars with oil from the full vessel. Then the nineteen mules were loaded with thirty-seven robbers in jars, and the jar of oil, and reached the town by dusk.

The Captain stopped his mules in front of Ali Baba's house, and said to Ali Baba, who was sitting outside for coolness, "I have brought some oil from a distance to sell at tomorrow's market, but it is now so late that I know not where to pass the night, unless you will do me the favor to take me in."

Though Ali Baba had seen the Captain of the robbers in the forest, he did not recognize him in the disguise of an oil merchant. He bade him welcome, opened his gates for the mules to enter, and went to Morgiana to bid her prepare a bed and supper for his guest. He brought the stranger into his hall, and after they had supped went again to speak to Morgiana in the kitchen, while the Captain went into the yard under pretense of seeing after his mules, but really to tell his men what to do.

Beginning at the first jar and ending at the last, he said to each man, "As soon as I throw some stones from the window of the chamber where I lie, cut the jars open with your knives and come out, and I will be with you in a trice."

He returned to the house, and Morgiana led him to his chamber. She then told Abdallah, her fellow slave, to set on the pot to make some broth for her master, who had gone to bed. Meanwhile her lamp went out, and she had no more oil in the house.

"Do not be uneasy," said Abdallah; "go into the yard and take some out of one of those jars."

Morgiana thanked him for his advice, took the oil pot, and went into the yard. When she came to the first jar the robber inside said softly, "Is it time?"

Any other slave but Morgiana, on finding a man in the jar instead of the oil she wanted, would have screamed and made a noise; but she, knowing the danger her master was in, bethought herself of a plan, and answered quietly, "Not yet, but presently."

She went to all the jars, giving the same answer, till she came to the jar of oil. She now saw that her master, thinking to entertain an oil merchant, had let thirty-eight robbers into his house. She filled her oil pot, went back to the kitchen, and, having lit her lamp, went again to the oil jar and filled a large kettle full of oil. When it boiled she went and poured enough oil into every jar to stifle and kill the robber inside. When this brave deed was done she went back to the kitchen, put out the fire and the lamp, and waited to see what would happen.

In a quarter of an hour the Captain of the robbers awoke, got up, and opened the window. As all seemed quiet, he threw down some little pebbles which hit the jars. He listened, and as none of his men seemed to stir he grew uneasy, and went down into the yard. On going to the first jar and saying, "Are you asleep?" he smelt the hot boiled oil, and knew at once that his plot to murder Ali Baba and his household had been discovered. He found all the gang was dead, and, missing the oil out of the last jar, became aware of the manner of their death. He then forced the lock of a door leading into a garden, and climbing over several walls made his escape. Morgiana heard and saw all this, and, rejoicing at her success, went to bed and fell asleep.

At daybreak Ali Baba arose, and, seeing the oil jars still there, asked why the merchant had not gone with his mules. Morgiana bade him look in the first jar and see if there was any oil. Seeing a man, he started back in terror. "Have no fear," said Morgiana; "the man cannot harm you; he is dead."

Ali Baba, when he had recovered somewhat from his astonishment, asked what had become of the merchant.

"Merchant!" said she, "he is no more a merchant than I am!" and she told him the whole story, assuring him that it was a plot of the robbers of the forest, of whom only three were left, and that the white and red chalk marks had something to do with it. Ali Baba at once gave Morgiana her freedom, saying that he owed her his life. They then buried the bodies in Ali Baba's garden, while the mules were sold in the market by his slaves.

The Captain returned to his lonely cave, which seemed frightful to him without his lost companions, and firmly resolved to avenge them by killing Ali Baba. He dressed himself carefully, and went into the town, where he took lodgings in an inn. In the course of a great many journeys to the forest he carried away many rich stuffs and much fine linen, and set up a shop opposite that of Ali Baba's son. He called himself Cogia Hassan, and as he was both civil and well dressed he soon made friends with Ali Baba's son, and through him with Ali Baba, whom he was continually asking to sup with him.

Ali Baba, wishing to return his kindness, invited him into his house and received him smiling, thanking him for his kindness to his son.

When the merchant was about to take his leave Ali Baba stopped him, saying, "Where are you going, sir, in such haste? Will you not stay and sup with me?"

The merchant refused, saying that he had a reason; and, on Ali Baba's asking him what that was, he replied, "It is, sir, that I can eat no victuals that have any salt in them."

"If that is all," said Ali Baba, "let me tell you that there shall be no salt in either the meat or the bread that we eat to-night."

He went to give this order to Morgiana, who was much surprised.

"Who is this man," she said, "who eats no salt with his meat?"

"He is an honest man, Morgiana," returned her master; "therefore do as I bid you."

But she could not withstand a desire to see this strange man, so she helped Abdallah to carry up the dishes, and saw in a moment that Cogia Hassan was the robber Captain, and carried a dagger under his garment.

"I am not surprised," she said to herself, "that this wicked man, who intends to kill my master, will eat no salt with him; but I will hinder his plans."

She sent up the supper by Abdallah, while she made ready for one of the boldest acts that could be thought on. When the dessert had been served, Cogia Hassan was left alone with Ali Baba and his son, whom he thought to make drunk and then to murder them. Morgiana, meanwhile, put on a headdress like a dancing-girl's, and clasped a girdle round her waist, from which hung a dagger with a silver hilt, and said to Abdallah, "Take your tabor, and let us go and divert our master and his guest."

Abdallah took his tabor and played before Morgiana until they came to the door, where Abdallah stopped playing and Morgiana made a low courtesy.

"Come in, Morgiana," said Ali Baba, "and let Cogia Hassan see what you can do"; and, turning to Cogia Hassan, he said, "She's my slave and my housekeeper."

Cogia Hassan was by no means pleased, for he feared that his chance of killing Ali Baba was gone for the present; but he pretended great eagerness to see Morgiana, and Abdallah began to play and Morgiana to dance. After she had performed several dances she drew her dagger and made passes with it, sometimes pointing it at her own breast, sometimes at her master's, as if it were part of the dance. Suddenly, out of breath, she snatched the tabor from Abdallah with her left hand, and, holding the dagger in her right hand, held out the tabor to her master. Ali Baba and his son put a piece of gold into it, and Cogia Hassan, seeing that she was coming to him, pulled out his purse to make her a present, but while he was putting his hand into it Morgiana plunged the dagger into his heart.

"Unhappy girl!" cried Ali Baba and his son, "what have you done to ruin us?"

"It was to preserve you, master, not to ruin you," answered Morgiana. "See here," opening the false merchant's garment and showing the dagger; "see what an enemy you have entertained! Remember, he would eat no salt with you, and what more would you have? Look at him! he is both the false oil merchant and the Captain of the Forty Thieves."

Ali Baba was so grateful to Morgiana for thus saving his life that he offered her to his son in marriage, who readily consented, and a few days after the wedding was celebrated with greatest splendor.

At the end of a year Ali Baba, hearing nothing of the two remaining robbers, judged they were dead, and set out to the cave. The door opened on his saying, "Open Sesame!" He went in, and saw that nobody had been there since the Captain left it. He brought away as much gold as he could carry, and returned to town. He told his son the secret of the cave, which his son handed down in his turn, so the children and grandchildren of Ali Baba were rich to the end of their lives.