The Princess and the Goblin is a children's fantasy novel written by George MacDonald in 1872. It was made into a full-length animated film in 1992 by József Gémes, and was jointly animated in Hungary and Wales.
When a peaceful kingdom is menaced by an army of monstrous goblins, the brave and beautiful Princess Irene joins forces with resourceful peasant boy Curtie to rescue the noble king and all his people. The lucky pair must battle the evil power of the wicked goblin prince armed only with the gift of song, the miracle of love, and a magical shimmering thread.
As the novel is in the public domain it can be read for free here. A sequel, The Princess and Curdie, was written in 1883, and can be read here.