Clever Maria is a Portuguese fairy tale. Andrew Lang included it in The Crimson Fairy Book.[1]
A merchant had three daughters, and the youngest, Maria, was the most beautiful. The merchant gave each daughter a pot of basil and forbade them to receive visitors. One day, the king came with two friends. Maria said she and her sisters would get wine from the cellar. The king said they were not thirsty. The sisters said they would not go. Maria said she would go just the same. Then she ran to a neighbour's and stayed there the night. The king was angry, but her basil did not wither, as her sisters' did.
The daughters looked over at the king's garden, and the oldest daughter asked Maria to climb down a rope and steal some fruit for her. A gardener caught her, but she escaped. The next day, the second daughter asked her to steal a fruit basket for her, but this time the king caught her. He questioned her, she denied nothing, and he told her to follow him to the house. Though he turned to make sure she followed him, she managed to escape. He fell ill.
Meanwhile, her two sisters had married the king's friends and had babies. Maria took the babies to show the king. Maria went about, calling for someone to give the babies to the king, who was sick of love. The king bought it and was infuriated that he held the babies. He knew the merchant had returned and ordered him to bring him a coat of stone or lose his head. Maria told him to take the fabric to the castle and demanded to measure the king. The king changed his order: he had to bring not the coat but his daughter Maria. Maria told her father to make her a doll of herself, with strings so she could make it nod and shake its head. Maria went to the castle and hid behind the doll. When the king recounted her misdeeds, she made the doll nod. Because she was mocking him, he cut off the doll's head. Its head fell toward him, and he said that the man who killed her deserved to die and turned the sword on himself. Maria jumped out to stop him. They married and lived happily.
The Italian Sapia Liccarda is another variant of this tale.