Eight-year-old Princess Irene lives a lonely life in a castle in a wild, desolate, mountainous kingdom, with only her nursemaid, "Lootie" for company. Her father the king is normally absent attending to affairs of state, and her mother is dead. Irene has never known about the existence of the goblins which lurk in the underground mines but her nursemaid Lootie does know about them. These goblins are grotesque and hideous beings, who centuries ago were human, but due to various reasons, they were driven underground and became malformed and distorted by their new lifestyle. This caused them to despise the humans above the ground and vow revenge against them.
One rainy day the princess is confined to her nursery in boredom and runs upstairs to explore parts of the castle she has never seen. She finds a room at the top of the castle where sits a beautiful old lady, with silver hair but smooth and youthful skin. This lady tells Irene she is her great-great-grandmother. Nobody knows that she lives up there. The great-great-grandmother shows Irene her many pigeons, that live on the castle roof, and whose eggs she eats as her only food source. Then she shows Irene the way back downstairs, knowing her nursemaid will be worried about her.
When she gets back, the princess tells Lootie about meeting the great-great-grandmother, but Lootie does not believe her. This makes the princess very upset. The next day she tries to go back and find her great-great grandmother again, but this time she cannot find her way back to the secret room.
The next day it has stopped raining and Princess Irene persuades Lootie her nursemaid to take her for a walk outside. They stay out too late, and after dark they are chased by goblins (who only appear on the surface at night, as sunshine repulses them).
Lootie and Irene escape the goblins after a miner-boy appears and sings loudly to the goblins. His song drives them away and the miner-boy, whose name is Curdie, explains that goblins are repelled by song. He walks the two home, and he and Irene begin to become friends as they chatter on the way. Much to the nursemaid's dismay, the princess promises Curdie a kiss as thanks for saving her. However, Curdie declines, and leaves Irene at the palace, though he promises to come back to claim the kiss at a later date.
Curdie goes to work in the mine next day with the rest of the miners and stays behind alone at night to do some extra work. When the other miners have left, Curdie overhears the goblins talking. Their conversation reveals to Curdie the secret weakness of goblin anatomy: they have very soft, vulnerable feet. They also have no toes. So now Curdie knows a second way to defeat a goblin: as well as singing, he could also stamp on their feet.
Curdie sneaks into the Great Hall of the goblin palace to eavesdrop on their general meeting, and finds out that the goblins are planning to flood the mine if a certain other part of their wicked plan should fail. He does not hear them say what the other part of their plan is. After the meeting Curdie goes home and tells his father what he has heard the goblins say.
Back in the palace, Princess Irene injures her hand and manages to find her great-great-grandmother again. The great-great-grandmother gently reproaches Irene for beginning to think that their first meeting must have just been a dream. She applies a special healing lotion to Irene's injured hand and then shows her that she is spinning a gift for Irene upon her spinning wheel. She is using a special kind of spider web as yarn; spider web that is brought for her by the pigeons in their beaks.
After promising she will not doubt her existence again and will return to visit her in exactly one week's time, Irene cuddles into the great-great-grandmother and goes to sleep in her arms in the tower room upstairs. Then she wakes up the next morning to find herself back in her own bed downstairs with her hand completely healed.
A week later Irene is about to go upstairs to see her great-great-grandmother again but is frightened by a long-legged cat that jumps in through her window. She runs out of the castle in fright, and escapes up the mountain and gets lost. However, the light from her great-great-grandmother's tower leads her back home and she returns to the tower room to find the old lady again, this time in the form of a youthful woman with blonde hair, not silver. The great-great-grandmother gives Irene a special ring attached to a thread of invisible spider's web yarn, and tells her that any time she is in danger she only needs to feel for the yarn and it will guide her to safety.
Meanwhile, in the mines Curdie is using a ball of string to prevent him from getting lost while he explores the extent of the goblins' domain. He is discovered by the goblins and stamps on their feet with great success, but when he tries to stamp on the Queen's feet she is uninjured due to her stone shoes.
The goblins shut Curdie up in a hole in the cave wall and block it up with stones and leave him there, thinking he will die of starvation. However, Irene's magic thread leads her into the mountain to rescue Curdie.
The magic thread leads the pair further into the mountain, and they come across the sleeping goblin king and queen. Curdie steals one of the queen's stone shoes, but before he can take the other she wakes up. The magic thread leads them safely back out of the mountain and comes out in the palace garden. Irene takes Curdie to see her great-great-grandmother and be introduced, but he cannot see her, as she is only visible to Irene. Curdie thinks Irene is playing make-believe and goes home feeling offended.
Curdie finds out that the goblins are digging a tunnel in the mines towards the king's palace. Their evil plan is revealed: they plan to abduct the Princess and marry her to goblin prince Prince Harelip, the half-breed heir to the throne of the goblin kingdom. Curdie warns the palace guards about this but they do not believe him and lock him up as a prisoner.
While he is imprisoned Curdie is asleep with a fever due to a wound in his leg. The great-great-grandmother comes to him and heals the wound. Meanwhile, the goblins break through their secret tunnel underneath the palace floor and come to abduct the princess just like Curdie had warned. They overcome the palace guards, but Curdie escapes from his prison room and stamps on the goblins' feet.
The goblins run away back down their hole and the palace staff begin to search for the princess but cannot find her anywhere. They fear she has been abducted by the goblins, who have now vanished back down the hole and blocked it up, but Curdie follows the magic thread to find her and it leads him back to his own house, where the thread earlier led the princess to safety. Curdie returns the princess to the palace and the king and the palace staff are overjoyed to have her back safe and sound.
At this point Irene asks for permission from the king to give Curdie the promised kiss, explaining how he has saved her. The king agrees, so Irene kisses Curdie on the lips.
Because they failed to abduct the princess, the goblins have now moved onto their plan B: flooding the mines. But the water, instead of staying down in the mines, comes back up through the hole in the palace floor, and Curdie only just has time to warn everybody so that they can all run up the mountain to escape being drowned. The goblins end up being drowned in the water themselves because their plan went so badly wrong.
The king is so grateful to Curdie that he asks him to come and work for him as a bodyguard but Curdie refuses, saying he cannot leave his mother and father. The king asks him what he can do for him as a reward, and the humble Curdie, instead of asking for great riches or wealth, asks for the one thing he has been saving up for: a new red petticoat for his mother.