In a town in Persia, there lived two brothers, one named Cassim, the other Ali Baba. Their father left them scarcely any thing; but as he had divided his little property equally between them, it should seem their fortune ought to have been equal; but chance determined otherwise.

Cassim married a wife who soon after became heiress to a large sum, and a warehouse full of rich goods; so that he all at once became one of the richest and most considerable merchants, and lived at his ease.

Ali Baba on the other hand, who had married a woman as poor as himself, lived in a very wretched habitation, and had no other means to maintain his wife and children but his daily labour of cutting wood, and bringing it upon three asses, which were his whole substance, to town to sell.

One day, when Ali Baba was in the forest, and had just cut wood enough to load his asses, he saw at a distance a great cloud of dust, which seemed to be driven towards him: he observed it very attentively, and distinguished soon after a body of horse. Though there had been no rumour of robbers in that country, Ali Baba began to think that they might prove such, and without considering what might become of his asses, was resolved to save himself. He climbed up a large, thick tree, whose branches, at a little distance from the ground, were so close to one another that there was but little space between them. He placed himself in the middle, from whence he could see all that passed without being discovered; and the tree stood at the base of a single rock, so steep and craggy that nobody could climb up it.

The troop, who were all well mounted and armed, came to the foot of this rock, and there dismounted. Ali Baba counted forty of them, and, from their looks and equipage, was assured that they were robbers. Nor was he mistaken in his opinion: for they were a troop of banditti, who, without doing any harm to the neighbourhood, robbed at a distance, and made that place their rendezvous; but what confirmed him in his opinion was, that every man unbridled his horse, tied him to some shrub, and hung about his neck a bag of corn which they brought behind them. Then each of them took his saddle wallet, which seemed to Ali Baba to be full of gold and silver from its weight. One, who was the most personable amongst them, and whom he took to be their captain, came with his wallet on his back under the tree in which Ali Baba was concealed, and making his way through some shrubs, pronounced these words so distinctly, "Open, Sesame," that Ali Baba heard him. As soon as the captain of the robbers had uttered these words, a door opened in the rock; and after he had made all his troop enter before him, he followed them, when the door shut again of itself.

The robbers stayed some time within the rock, and Ali Baba, who feared that some one, or all of them together, might come out and catch him, if he should endeavour to make his escape, was obliged to sit patiently in the tree. He was nevertheless tempted to get down, mount one of their horses, and lead another, driving his asses before him with all the haste he could to town; but the uncertainty of the event made him choose the safest course.

At last the door opened again, and the forty robbers came out. As the captain went in last, he came out first, and stood to see them all pass by him; when Ali Baba heard him make the door close by pronouncing these words, "Shut, Sesame." Every man went and bridled his horse, fastened his wallet, and mounted again; and when the captain saw them all ready, he put himself at their head, and they returned the way they had come.

Ali Baba did not immediately quit his tree; for, said he to himself, they may have forgotten something and may come back again, and then I shall be taken. He followed them with his eyes as far as he could see them; and afterwards stayed a considerable time before he descended. Remembering the words the captain of the robbers used to cause the door to open and shut, he had the curiosity to try if his pronouncing them would have the same effect. Accordingly, he went among the shrubs, and perceiving the door concealed behind them, stood before it, and said, "Open, Sesame." The door instantly flew wide open.

Ali Baba, who expected a dark dismal cavern, was surprised to see it well lighted and spacious, in form of a vault, which received the light from an opening at the top of the rock. He saw all sorts of provisions, rich bales of silk, stuff, brocade, and valuable carpeting, piled upon one another; gold and silver ingots in great heaps, and money in bags. The sight of all these riches made him suppose that this cave must have been occupied for ages by robbers, who had succeeded one another.

Ali Baba did not stand long to consider what he should do, but went immediately into the cave, and as soon as he had entered, the door shut of itself. But this did not disturb him, because he knew the secret to open it again. He never regarded the silver, but made the best use of his time in carrying out as much of the gold coin, which was in bags, at several times, as he thought his three asses could carry. He collected his asses, which were dispersed, and when he had loaded them with the bags, laid wood over in such a manner that they could not be seen. When he had done he stood before the door, and pronouncing the words, "Shut, Sesame," the door closed after him, for it had shut of itself while he was within, but remained open while he was out. He then made the best of his way to town.