Ali Baba was a poor woodcutter who discovered a secret cave filled with treasure belonging to a band of 40 thieves. While the thieves were away, Ali Baba took some of the treasure but was nearly caught upon their return. With the help of his brother Cassim and his wits, Ali Baba outsmarted the thieves and lived happily with the treasure.