There was once a rich King who had three daughters. He loved fine trees, especially one apple tree. He declared that anyone who picked an apple from it should be buried a hundred fathoms underground.
At harvest time, the apples were red as blood. The King's youngest daughter, craving an apple, convinced her sisters that their father's threat didn't apply to them. She picked a large apple, and after all three tasted it, they sank deep into the earth.
When the King couldn't find them, he promised one daughter in marriage to whoever rescued them. Many searched, including three huntsmen. After eight days, they found an empty castle with a warm, laid table. They decided to stay, drawing lots to see who would guard the castle each day while the others searched.
The eldest stayed first. At noon, a tiny mannikin came begging for bread. When the huntsman gave him a piece, the mannikin dropped it and asked him to pick it up. As the huntsman stooped, the mannikin beat him with a stick. The same happened to the second brother the next day. They hid this from the youngest, whom they disliked and called "Stupid Hans."
On the third day, Hans stayed. When the mannikin repeated his trick, Hans refused to pick up the bread, saying, "If you won't take trouble for your bread, you don't deserve it." He then beat the angry mannikin, who cried out, "Stop! I'll tell you where the King's daughters are!"
The mannikin revealed he was an earth-elf and showed Hans a dry well. He warned that Hans's companions were dishonest, so Hans must act alone. The elf instructed Hans to be lowered in a basket with a bell and a hanger (a short sword). Below were three rooms, each with a princess forced to comb a many-headed dragon; Hans must cut off the heads. Then the elf vanished.
That evening, Hans told his brothers only that he had beaten a mannikin who revealed the princesses' location. Enraged, the brothers grew "green and yellow." The next day at the well, they drew lots to go down first. Both the eldest and second rang the bell to be pulled up immediately after descending a short way. Hans went last and descended fully.
He found the first princess combing a nine-headed dragon. He cut off the heads, and she embraced him, giving him a golden stomacher. He rescued the second princess from a five-headed dragon and the youngest from a four-headed one.
After sending the princesses up in the basket, Hans remembered the elf's warning. He sent up a large stone instead. His brothers cut the rope halfway, thinking they had killed him. They forced the princesses to claim credit and went to claim their brides.
Trapped below, Hans found a flute on the wall. Playing it summoned elves—one for each note. When the room was full, they asked his wish. He asked to return to daylight, and they flew him up by his hair.
He arrived at the palace during a wedding. The princesses fainted at the sight of him. The angry King imprisoned him, thinking he had harmed them. When the princesses revived, they begged for his release but said they could only tell their secret to the stove. The King listened at the door and heard the truth.
The King hanged the two treacherous brothers and gave his youngest daughter to Hans. The story ends with the narrator's quirky remark: "...and on that occasion I wore a pair of glass shoes, and I struck them against a stone, and they said, 'Klink,' and were broken."