KidsOut World Stories

Ali Baba and the Forty Thieves Mary Smith    
Previous page
Next page

Ali Baba and the Forty Thieves

A free resource from

Begin reading

This story is available in:






Ali Baba and the Forty Thieves 

A tale from the Arabian Nights










Each evening Ali Baba went out to gather twigs and branches for his wife so that she had enough firewood to cook the stew for dinner.

One day, Ali Baba went further than usual to hunt for fallen branches beneath the trees that grew beside the rocky cliffs near the high hills.

Suddenly, he heard a great clatter of hooves on the rocky path. He was afraid. He climbed the nearest tree and hid among the leaves.

He was well hidden but was able to peer between the leaves. He was astonished to see a long line of men on horseback, riding one behind the other.

Ali Baba counted them as they rode beneath the tree where he hid.

‘One … two … three … four,’ and many, many more, until he had counted forty.

Finally, the forty riders reached a cliff face. They dismounted and removed the saddlebags from their horses’ backs. Ali Baba noticed that the bags were bulging.

‘Perhaps the bags are full of treasure,’ thought Ali Baba. ‘These men are thieves and robbers. Maybe they are about to hide their loot.’

The thieves lined up behind their leader. They were right in front of the steep rocky cliff.

‘How silly!’ Ali Baba thought. ‘There is nowhere to hide treasure here.’

At that moment, one of the riders spoke loudly.

'Open Sesame!' he cried.

Suddenly, a secret door in the rock opened. The forty riders entered a hidden cave. They were going to hide the treasure they had stolen.

When they were all inside, the leader shouted, ‘Close Sesame!’

The secret door closed again with the thieves hidden safely inside.

Ali Baba waited, hidden in his treetop until the riders came out of the cave again. He counted carefully to make sure that they were all out.

‘One … two … three … four,’ and many, many, many more until he reached thirty-nine.

Last of all came the leader. When he stood outside the cave, he again said, ‘Close Sesame!’

The secret rock door closed.

Ali Baba peered through the leaves. He was amazed to see how perfectly the door fitted into the rock.

The thieves put the empty saddlebags over their horses. Then they set off, one by one.

Ali Baba counted to make sure that they had all gone. ‘One … two … three … four,’ and many, many, many more until he reached forty. Then he listened until he could no longer hear any hooves clattering – he was safe!

Ali Baba climbed down the tree and walked up to the rocky cliff. He was curious to discover if the magic door would open for him if he said the special word. Would he be brave enough to try?

Ali Baba stood there. He looked at the rocky cliff. He thought about all the treasure in the cave, and he thought about the forty thieves. He couldn’t hear anything at all.

At last, he decided, ‘I must be safe now. So I shall be brave and say the magic words out loud.’

Then Ali Baba went close to the rocky cliff.

‘Open Sesame!’ he said. The door opened.

Ali Baba could see steps leading down. Little lamps of burning oil lit the stairway. He was just about to descend the steps when he remembered. The leader of the thieves had spoken two words to close the magic door.

Ali Baba decided that he should shut the magic door too. It would not be a good idea for anyone else to see the entrance to the cave of treasure.

‘Close Sesame!’ he cried, and the magic door slid shut.

After that, Ali Baba crept down the stone steps until he reached the treasure cave. He gazed all around in amazement. There were thousands of sparkling jewels in great heaps: diamonds, rubies, emeralds and every other sort of precious gem. Then there was gold! Ali Baba’s eyes grew wide in wonder when he saw the vast piles of gold coins.

However, Ali Baba was not greedy. He didn’t want the diamonds, or the rubies or the emeralds. Although Ali Baba was a poor man, he had no desire to take all the gold coins. He wanted just one little gold coin. It would be enough to buy food for himself and his family.

So Ali Baba took one small coin and ran back up the stone steps. At the top, he took a deep breath.

'Open Sesame!' he gasped.

Immediately the magic door opened. With a sigh of relief, Ali Baba hurried outside. Then he turned and called out the magic words.

‘Close Sesame!’

The door slid shut. Ali Baba was safe.

However, there was something Ali Baba did not know. His brother, Kassim, had also come to find firewood. Kassim had seen Ali Baba come out of the cave and speak some magic words. He had seen the magic rock door close.

‘Oh, Ali Baba! My brother! What is this magic that I have just seen?’

Ali Baba told his brother everything. He warned Kassim that the forty thieves might return any minute. So they both gathered up armfuls of firewood, and they hurried home, each to their own house.

Ali Baba was pleased to have his one small gold coin. His wife was also pleased to have one small gold coin. However, in the house next door, Kassim was not pleased. He was greedy. Kassim told his wife all about his younger brother’s adventure. His wife was not pleased. She was just as greedy as her husband.

‘Kassim,’ she said. ‘Go back to the rocky cliffs and say the magic words. Go down into the cave and fetch me some jewels and gold coins. I want lots of large gold coins.’ She gave him a large bag to carry all the treasure.

Kassim did as his wife had said. He took the bag and ran back to the rocks.

In front of the cliff, he said the magic words. ‘Open Sesame!’

When the secret door opened, Kassim hurried inside.

He spoke the magic words to close the door. ‘Close Sesame!’

The little oil lamps were still alight. Kassim was able to see the stairway that led down to the treasure cave. He ran down the stone steps as fast as he could.

When Kassim saw all the sparkling jewels and glistening gold, his eyes lit up with greed. He began stuffing gems and coins into his bag. It was soon filled to the brim; there was no room for any more treasure.

Kassim became so excited that something dreadful happened. He forgot the magic words! Kassim ran up the stone steps and stood in front of the magic door.

‘Open Barley!’ he cried.

Nothing happened.

‘Open Oats!’

Nothing happened.

Kassim was worried.

‘I know it was something to eat,’ he said to himself. So he tried everything he could think of.

‘Open Wheat! Open Rye! Open Pumpkin! Open Melon!’

At that moment, something even more dreadful happened. The magic door slid open, and there stood the thieves who had stolen the treasure.

‘Robbers!’ squealed Kassim. Before he had time to count them, the leader pulled out his sword. He threatened Kassim with his sharp curved blade.

The thieves’ leader saw that Kassim’s was bag bulging with their treasure.

He poked his sword into Kassim, and the greedy man fell down, never to move again.

That night Kassim’s wife became worried when her husband didn’t return home with any treasure. She went next door to Ali Baba.

Ali Baba listened to her story, and he feared the worst. ‘I had better go and find him,’ he said to her.

He was afraid that the thieves had found Kassim.

Ali Baba took a lantern and went up into the rocky mountains to look for his brother. On the ground in front of the hidden cave lay Kassim’s dead body.

Ali Baba lifted his brother and carried him back home so that the family could bury him properly.

The next day the thieves returned to their hidden cave with more treasure that they had stolen. The thieves’ leader expected to see the lifeless body of the man he had killed – but it wasn’t there!

‘Stop! Wait!’ the leader cried. He bent down to study the ground, and he was able to see the tracks from where the body had been taken.

‘We must hide our treasure quickly,’ he cried out to the others. ‘I must follow these tracks. It seems as though someone else knows of our secret hiding place. Go home and sharpen your swords. Be ready for a fight tomorrow. Hire a large cart and a strong donkey. Buy thirty-nine large olive oil jars that are big enough to hide inside. Make a hole in each lid so that you can get fresh air into the jar to breathe. Make sure everything is ready and then meet me here tomorrow at daybreak.’

While the thirty-nine robbers did as he had said, their leader followed the tracks all the way to Ali Baba’s house.

‘When I come back tomorrow,’ said the thief to himself. ‘I shall pretend to be a seller of fine quality olive oil. I shall park my cart of olive oil jars in this man’s yard, and I’ll go and knock on his door. When I shout, ‘Olive oil!’ my thieves will come rushing in with their swords drawn, ready for a fight.’

Little did the man know, Ali Baba’s maid, Morgiana, had come quietly out of the back door of the house. She overheard every word that the man muttered to himself.

He continued talking to himself. ‘In my cart, I shall have thirty-nine olive oil jars. In each jar, I shall have a man armed with a sharp sword.’ The man gave an evil laugh. ‘When the man inside opens the door he won’t know what hit him!’

Morgiana crept back into the house to tell Ali Baba what she had overheard. She began by saying, ‘I have a plan …’ and then she told Ali Baba what her plan was.

The next day, early in the morning, the thieves met up with their leader. There were thirty-nine enormous jars on the cart. A man hid in each empty olive oil jar. Their leader put a lid on the top of each jar.

A sturdy donkey pulled the heavy cart to Ali Baba’s house. The thieves’ leader parked his cart in Ali Baba’s yard. Then he went and knocked on the door.

Ali Baba opened the door.

‘You’re an olive oil merchant?’ he said. ‘Splendid, that is just what we need. I shall buy a jar from you. I will pay you a good price, but first, come in and have a drink with us.’

The man happily accepted a drink, but he didn’t know that Morgiana had put sleeping powder into the liquid.

Morgiana crept into the yard. She was carrying a dish of soft cheese, and she used it to plug all the breathing holes in the jars. When the thieves had no more fresh air to breathe, they collapsed into the bottom of their jars.

Morgiana then ran to the house of the village Sheikh. She knocked politely on the door and told her story as soon as she was taken inside.

‘Evil men came to the house of Ali Baba. They came armed with sharp swords to kill him, but I have managed to trick them and trap them. They are the ones who have been robbing the travellers on the road to our village. They have been stealing from people in all the towns and villages near here.’

The Sheikh called on the guards. They went to Ali Baba’s house and captured all forty thieves.

‘My dungeon is deep and has many chambers,’ said the Sheikh. ‘There is plenty of space to keep them there for a long, long time. Bread, water and a hard stone floor – that’s good enough for them.’

Then the guards went with Ali Baba to bring all the treasure back to the village. The Sheikh tried to return all the jewels and all the money to their rightful owners. In the end, there was still some treasure left over. So the Sheikh shared what remained with Ali Baba and Morgiana.

Ali Baba’s son fell in love with Morgiana. She eventually married him, and so this story had a happy ending for Ali Baba and his family.

Enjoyed this story?
Find out more here