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 everything that was rare and costly, and went by the name of the merchant Cogia Hassan. Many persons made acquaintance with the stranger; among others, Ali Baba's son went every day to the shop. The pretended Cogia Hassan soon appeared to be very fond of Ali Baba's son, offered him many presents, and often detained him at 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 house 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 it was the pretended oil-merchant. The prudent Morgiana did not say a word to any one of this discovery, but sent the other slaves into the kitchen and waited at table herself; and while Cogia Hassan was drinking, she perceived he had a dagger hid under his coat.

When supper was ended, and the dessert 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 tabor while she danced. As soon as she appeared at the parlor 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 poniard 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 poniard 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 poniard 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 pulled off the turban and the cloak which the false Cogia Hassan wore and 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 showing any dislike, readily and joyfully accepted his proposed bride, having long entertained an affection for the good slave Morgiana.

Having rejoiced in their deliverance, 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. 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.