The Pig King is an Italian literary fairy tale written by Giovanni Francesco Straparola in his The Facetious Nights of Straparola.Madame d'Aulnoy wrote a French, also literary, variant, titled Prince Marcassin.
It is Aarne-Thompson type 441, In an Enchanted Skin; an episode of this opens The Enchanted Pig.
A king and a queen had no children after seven years. One day, the queen slept in the garden, and three fairies saw her. One gave her a son and that no man could harm her; the second, that no one could offend her, and the son should have every virtue; the third, that she would be wise, but the son should be a pig until he had married three times. Soon after, the queen had a son in the form of a pig. The king at first thought to throw the pig into the sea, but decided against it, and had him raised as a child. He learned to talk, but wallowed in mud whenever he could. One day, he told his mother that he wished to marry and persisted until the queen persuaded a poor woman to give her oldest daughter to him. The girl was persuaded by her mother but resolved to kill her bridegroom their wedding night. In the night, he stabbed her with his hooves, and she died. He then asked to marry her sister, and she was persuaded, but she died as her sister had. Finally, he married the third. The third sister behaved politely to him, and returned his caresses. Soon after their marriage, the prince revealed a secret to her: he took off his pigskin and became a handsome young man in her bed. Every morning, he put the skin back on, but she was glad to have a man as her husband. Soon, she gave birth to a child, a son in human form. But finally, the princess revealed the secret to the king and queen and told them to come to the bedchamber at night. They did, and saw their son. The king had the pigskin, lying to one side, torn to pieces, and then abdicated and had his son crowned. He was known as King Pig, and lived long and happily with his queen.
Madame d'Aulnoy greatly expanded the tale.
A queen who desperately wants to have a child dreams that three fairies talk about giving her a child: one gives her a handsome, amiable, and loved son; the second gives her to see the son succeed at everything; and the third muttered something under her breath. The king is anxious that the third fairy meant ill, but the queen is convinced her desire for a child made her dream it.