There they stayed for a long time. Ali Baba was compelled to wait in the tree with patience, as he was afraid some of them might come out if he left his hiding-place. At length the door opened, and the forty thieves came out. After he had seen all the troop pass out before him, the Captain exclaimed, "Shut Sesame!" Each man then bridled his horse, and mounted. When the Captain saw that all were ready, he put himself at their head, and they rode off as they had come.

Ali Baba did not come down from the tree at once, because he thought they might have forgotten something, and be obliged to come back, and that he should thus be caught. He watched them as long as he could; nor did he leave the tree for a long time after he had lost sight of them. Then, recalling the words the Captain had used to open and shut the door, he made his way through the bushes to it, and called out, "Open Sesame!" Instantly the door flew wide open!

Ali Baba expected to find only a dark cave, and was very much astonished at seeing a fine large chamber, dug out of the rock, and higher than a man could reach. It received its light from a hole in the top of the rock. In it were piled all sorts of rare fruits, bales of rich merchandise, silk stuffs and brocades, and great heaps of money, both silver and gold, some loose, some in large leather bags. The sight of alt these things almost took Ali Baba's breath away.

But he did not hesitate long as to what he should do. He went boldly into the cave, and as soon as he was there, the door shut; but since he knew the secret by which to open it, this gave him no fear. Leaving the silver, he turned to the gold which was in the bags, and when he had gathered enough for loading his three asses, he brought them to the rock, loaded them, and so covered the sacks of gold over with wood that no one could suspect anything. This done, he went to the door, and had no sooner said the words, "Shut Sesame," than it closed.

And now Ali Baba took the road to the town; and when he got home, he drove his asses into the yard and shut the gate with great care. He threw off the wood that hid the gold and carried the bags into the house, where he laid them down in a row before his wife, who was sitting upon a couch.

When he had told the whole story of the cave and the forty thieves, he emptied the sacks, making one great heap of gold that quite dazzled his wife's eyes. His wife began to rejoice in this good fortune, and was going to count over the money that lay before her, piece by piece.

"What are you going to do?" said he. "Why, you would never finish counting them. I will dig a pit to bury it in; we have no time to lose."

"It is right, though," replied the wife, "that we should know about how much there may be. I will go and borrow a small grain-measure, and while you are digging the pit, I will find how much there is."

So the wife of Ali Baba set off and went to her brother-in-law, Cassim, who lived a short way from her house. Cassim was away from home, so she begged his wife to lend her a measure for a few minutes. "That I will with pleasure," said Cassim's wife. She went to seek a measure, but knowing how poor Ali Baba was, she was curious to know what sort of grain his wife wanted to measure; so she put some tallow on the bottom of the measure in such a way that no one would notice it.

The wife of Ali Baba returned home, and placing the measure on the heap of gold, filled it over and over again, till she had measured the whole. Ali Baba by this time had dug the pit for it, and while he was burying the gold, his wife went back with the measure to her sister-in-law, but without noticing that a piece of gold had stuck to the bottom of it.