Jacob Pors, a young student who has been hired as a tutor for landowner Jesper Nørholm’s young children, is secretly engaged to the landowner’s oldest daughter, Agnete. Every night, when classes end, the young lovers take a stroll to Tvilshøj, a nearby hill where Jacob, who fancies himself a poet, recites his latest verse to Agnete. One evening, as they are sitting on Tvilshøj, "Shaggy Ane," the local eccentric, walks by. They make her tell the legend of Gillekop, the goblin said to be living inside the hill. Walking home, they agree it is time that Pors ask for Agnete’s hand in marriage. Unfortunately, Nørholm recently decided that his daughter should marry someone who has a knowledge of farming and could manage his lands, so he rejects Jacob. Throwing reason to the wind, Pors defiantly packs his bags and storms out without saying goodbye. Resting for a spell on the road by Tvilshøj, Jacob falls asleep and dreams he is looking into Gillekop’s cave where the goblin stands ready to leap up to the ground. Shortly after, Gillekop – having taken human form – is standing next to sleeping Jacob. The goblin wakes the young man and proceeds to praise his poetry. Before Jacob continues to town, Gillekop gives him a letter of introduction to Joakim, editor of "The Torch" and widely feared for his unsparing pen.
Gillekop vanishes back into his cave and rubs his hands with delight, knowing that he has planted the seed of temptation in Jacob. Gillekop’s chief goal now is to get Jacob Pors to desert his fiancée. In the city, Pors tries to find a publisher for his poems and, failing, calls on editor Joakim, who immediately takes him on as a variety critic. Again, Gillekop rubs his hands with glee: Jacob is on a slippery slope. A duel now ensues between the evil goblin and a good fairy who seems to follow Jacob everywhere, unseen. The upshot is that the young poet deserts his girl for a common music-hall singer. His goal has been met and all Gillekop now has to do is lure Jacob back to Tvilshøj. There, the goblin reveals himself and Jacob has to follow him down into the cave. Now, it’s Jacob’s lot – in the form of a goblin – to tend the eternal fire. Cackling, Gillekop and his evil crone leave their replacement behind in the cave. At that moment, Jacob wakes up. The dream has ended. It’s morning. Realising it was providence speaking to him in the dream, he returns to the manor. On the way, he meets Agnete and together they go to see her stern father to tell him that Jacob has regretted his rashness. Cured of his poetic aspirations, he happily forsakes all the pie-in-the-sky laurels of art and fame to live in happy understanding with the woman he loves.