A poor couple had a son named Halvor who was good for nothing but to sit about groping in the ashes. One day, a skipper asked him if he would like to go to sea. He went, and a storm blew them far off course. When Halvor got off the ship, he walked and found a castle. When he reached it, a princess warned him that a troll with three heads lived there and would eat him. Halvor refused to leave. The princess fed him and asked him to try to wield a sword. He could not, and she advised him to drink from a flask; afterwards, he could wield it. He killed the troll on its return. The princess told him of her two other sisters, also held captive by trolls, and Halvor rescued them as well, though one troll had six heads and the other nine.
They offered that any of them would marry him, and he chose the youngest princess, but he missed his parents and wanted to tell them what had happened. The princesses gave him a ring to wish himself there and back but warned him not to name them. His parents took a long time to recognize this grand lord as their son, but they were very pleased with him. The young women were abashed before him, because they used to mock him. He wished the princesses were there to show them how abashed they should be. They appeared. The youngest princess persuaded Halvor to lie down and sleep, put a ring on his finger, took the wishing ring and wished them back to Soria Moria Castle.
He set out to find them, bought a horse, and found a cottage with an old couple where the woman had a nose long enough to stir the fire with. He asked if they knew the way to Soria Moria Castle, and they did not, nor did the Moon when the old woman asked it, but the old woman traded him a pair of boots that took twenty miles a step for his horse, and asked him to wait for the West Wind. It knew where Soria Moria Castle was, and that there was to be a wedding there. Halvor set out with the West Wind to reach it.
There, Halvor put the ring the princess had given him into a cup and had it brought to the princess. She recognized it and married Halvor instead of the new bridegroom.