A woman with two daughters remarries after her first husband dies, and has a third daughter. She treats the third child badly. One day the king gives a ball for his son to choose a bride. A magic crab provides clothes and transportation for the third daughter to go to the ball. The prince is enamoured of her, but she goes away before midnight. At the second ball, she leaves behind her shoe as advised by the crab. The prince’s dog finds her and returns the shoe to her, after which the prince decides to marry her. But the King’s ministers forbid the wedding because of unequal ranks. A nearby princess is chosen as bride. On the day of the wedding, the crab becomes a fairy godmother and takes the forsaken girl to the church, where the wedding is interrupted and she takes the place of the princess.