The robber, having marked the door with a piece of chalk which he had provided for the purpose, removed the bandage from Mustapha's eyes, and leaving him to his own devices returned with all possible speed to the cave where his comrades were awaiting him.

Soon after the robber and cobbler had parted, Morgiana happened to go out upon an errand, and as she returned she noticed the mark upon the door. 'This,' she thought, 'is not as it should be; either some trick is intended, or there is evil brewing for my master's house.' Taking a piece of chalk she put a similar mark upon the five or six doors lying to right and left; and having done this she went home with her mind satisfied, saying nothing.

In the meantime the robbers had learned from their companion the success of his venture. Greatly elated at the thought of the vengeance so soon to be theirs, they formed a plan for entering the city in a manner that should arouse no suspicion among the inhabitants. Passing in by twos and threes, and by different routes, they came together to the market-place at an appointed time, while the captain and the robber who had acted as spy made their way alone to the street in which the marked door was to be found. Presently, just as they had expected, they perceived a door with the mark on it. 'That is it!' said the robber; but as they continued walking so as to avoid suspicion, they came upon another and another, till, before they were done, they had passed six in succession. So alike were the marks that the spy, though he swore he had made but one, could not tell which it was. Seeing that the design had failed, the captain returned to the market-place, and having passed the word for his troop to go back in the same way as they had come, he himself set the example of retreat.

When they were all reassembled in the forest, the captain explained how the matter had fallen, and the spy, acquiescing in his own condemnation, kneeled down and received the stroke of the executioner.

But as it was still necessary for the safety of all that so great a trespass and theft should not pass unavenged, another of the band, undeterred by the fate of his comrade, volunteered upon the same conditions to prosecute the quest wherein the other had failed. Coming by the same means to the house of Ali Baba, he set upon the door, at a spot not likely to be noticed, a mark in red chalk to distinguish it clearly from those which were already marked in white. But even this precaution failed of its end. Morgiana, whose eye nothing could escape, noticed the red mark at the first time of passing, and dealt with it just as she had done with the previous one. So when the robbers came, hoping this time to light upon the door without fail, they found not one but six all similarly marked with red.

When the second spy had received the due reward of his blunder, the captain considered how by trusting to others he had come to lose two of his bravest followers, so the third attempt he determined to conduct in person. Having found his way to Ali Baba's door, as the two others had done by the aid of Baba Mustapha, he did not set any mark upon it, but examined it so carefully that he could not in future mistake it. He then returned to the forest and communicated to his band the plan which he had formed. This was to go into the town in the disguise of an oil-merchant, bearing with him upon nineteen mules thirty-eight large leather jars, one of which, as a sample, was to be full of oil, but all the others empty. In these he purposed to conceal the thirty-seven robbers to which his band was now reduced, and so to convey his full force to the scene of action in such a manner as to arouse no suspicion till the signal for vengeance should be given.

Within a couple of days he had secured all the mules and jars that were requisite, and having disposed of his troop according to the pre-arranged plan, he drove his train of well-laden mules to the gates of the city, through which he passed just before sunset. Proceeding thence to Ali Baba's house, and arriving as it fell dark, he was about to knock and crave a lodging for the night, when he perceived Ali Baba at the door enjoying the fresh air after supper. Addressing him in tones of respect, 'Sir,' said he, 'I have brought my oil a great distance to sell to-morrow in the market; and at this late hour, being a stranger, I know not where to seek for a shelter. If it is not troubling you too much, allow me to stable my beasts here for the night.'

The captain's voice was now so changed from its accustomed tone of command, that Ali Baba, though he had heard it before, did not recognize it. Not only did he grant the stranger's request for bare accommodation, but as soon as the unlading and stabling of the mules had been accomplished, he invited him to stay no longer in the outer court but enter the house as his guest. The captain, whose plans this proposal somewhat disarranged, endeavoured to excuse himself from a pretended reluctance to give trouble; but since Ali Baba would take no refusal he was forced at last to yield, and to submit with apparent complaisance to an entertainment which the hospitality of his host extended to a late hour.

When they were about to retire for the night, Ali Baba went into the kitchen to speak to Morgiana; and the captain of the robbers, on the pretext of going to look after his mules, slipped out into the yard where the oil jars were standing in line. Passing from jar to jar he whispered into each, 'When you hear a handful of pebbles fall from the window of the chamber where I am lodged, then cut your way out of the jar and make ready, for the time will have come.' He then returned to the house, where Morgiana came with a light and conducted him to his chamber.