The Princess and the Goblin by George MacDonald
Chapter 32. The Last Chapter
All the rest went up the mountain, and separated in groups to the homes of the miners. Curdie and his father and mother took Lootie with them. And the whole way a light, of which all but Lootie understood the origin, shone upon their path. But when they looked round they could see nothing of the silvery globe.
For days and days the water continued to rush from the doors and windows of the king's house, and a few goblin bodies were swept out into the road.
Curdie saw that something must be done. He spoke to his father and the rest of the miners, and they at once proceeded to make another outlet for the waters. By setting all hands to the work, tunnelling here and building there, they soon succeeded; and having also made a little tunnel to drain the water away from under the king's house, they were soon able to get into the wine cellar, where they found a multitude of dead goblins - among the rest the queen, with the skin-shoe gone, and the stone one fast to her ankle - for the water had swept away the barricade, which prevented the men-at-arms from following the goblins, and had greatly widened the passage. They built it securely up, and then went back to their labours in the mine.
A good many of the goblins with their creatures escaped from the inundation out upon the mountain. But most of them soon left that part of the country, and most of those who remained grew milder in character, and indeed became very much like the Scotch brownies. Their skulls became softer as well as their hearts, and their feet grew harder, and by degrees they became friendly with the inhabitants of the mountain and even with the miners. But the latter were merciless to any of the cobs' creatures that came in their way, until at length they all but disappeared.
The rest of the history of The Princess and Curdie must be kept for another volume.