In Norse mythology, Útgarða-Loki (Anglicized as Utgarda-Loki and Utgard-Loki) was the ruler of the castle Útgarðr in Jötunheimr. He was one of the Jötnar and his name means literally "Loki of the Outyards," to distinguish him from Loki, the companion of Thor.
In the Prose Edda book Gylfaginning (chapter 44), the enthroned figure of Third reluctantly relates a tale in which Thor, Loki and Thor's servants, Þjálfi and Röskva are traveling to the east. They arrive at a vast forest in Jötunheimr, and they continue through the woods until dark. The four seek shelter for the night and discover an immense building. Finding shelter in a side room, they experience earthquakes through the night. The earthquakes cause all four to be fearful, except Thor, who grips his hammer in defense. The building turns out to be the huge glove of Skrýmir, who has been snoring throughout the night, causing what seemed to be earthquakes. The next night, all four sleep beneath an oak tree near Skrýmir in fear.
Thor wakes up in the middle of the night, and a series of events occur where Thor twice attempts to destroy the sleeping Skrýmir with his hammer. Skrýmir awakes after each attempt, only to say that he detected an acorn falling on his head or that he wonders if bits of tree from the branches above have fallen on top of him. The second attempt awakes Skrýmir. Skrýmir gives them advice; if they are going to be cocky at the castle of Útgarðr it would be better for them to turn back now, for Útgarða-Loki's men there won't put up with it. Skrýmir throws his knapsack onto his back and abruptly goes into the forest and "there is no report that the Æsir expressed hope for a happy reunion".
The four travelers continue their journey until midday. They find themselves facing a massive castle in an open area. The castle is so tall that they must bend their heads back to their spines to see above it. At the entrance to the castle is a shut gate, and Thor finds that he cannot open it. Struggling, all four squeeze through the bars of the gate, and continue to a large hall. Inside the great hall are two benches, where many generally large people sit on two benches. The four see Útgarða-Loki, the king of the castle, sitting.