The Princess and the Goblin is a fantasy book by George MacDonald
The story takes place in a magical kingdom where a little princess, Irene, was sent to live with a nanny due to her mother's poor health. The large house where Irene spends her days is part fortress and part farm, and is located halfway up a high mountain in a mining region.
Once upon a time there was a region inhabited by a nation of miners. Oppressed by heavy taxes and abusive nobles, people sought refuge in their mines and eventually adapted to their dark surroundings. Over time, they mutated into hideous goblins, and their existence became the subject of legends and whispers.
Though horribly deformed, goblins are cunning and intelligent. They built an extremely complex system of tunnels linked by galleries, underground passages and waterways that nest the entire mountain.
Goblins hate the surface dwellers, blaming them for their plight. Thus, goblins never miss an opportunity to harass and harm people on the surface, and have a special hatred for the human miners who descend into their realm.
On a rainy day, the little princess is bored and therefore begins to explore the large dusty rooms of her new home. Without realizing it, the princess enters a labyrinth of hallways and rooms, all abandoned and dusty. In one, she finds a beautiful old lady sitting at a loom (recalling one of the Greek destinies and the destiny they spun for men). The old lady reveals that she is the princess' great-grandmother and that she has the same name as Irene. She shows Irene that she lives by eating pigeon eggs collected from the roof and tells the princess that it is her job to watch over Irene.
Later, Irene returns to the normal part of the house and tells the nanny about her adventures, but is not believed. Irene tries to find her great-grandmother but cannot find the secret part of the house.
She and her nanny go out for a walk, but they stay too late and it is dark. The goblins are repelled by the light but come out at night and they start hunting the princess and her nanny. The couple are saved by Curdie, a slightly older boy. Curdie is a miner and knows the ways of goblins. He hunts them by singing, as goblins are repelled by beautiful sounds as well.
Curdie escorts the princess home and from there they become friends and embark on a series of adventures. It is suggested that the two might become more than friends as they get older.
While exploring the caverns and mines, the two discover that the goblins have devised an evil plan to drown the human village by diverting underground rivers. Aided by the courage of Curdies and a magical ring given to the princess by her magical grandmother, the two foil the plot of the drowning goblins instead.