In 965 AD, Odin, king of Asgard, wages war against the Frost Giants of Jotunheim and their leader Laufey, to prevent them from conquering the nine realms, starting with Earth. The Asgardian warriors defeat the Frost Giants and seize the source of their power, the Casket of Ancient Winters.
In the present, Odin's son Thor prepares to ascend to the throne of Asgard, but is interrupted when Frost Giants attempt to retrieve the Casket. Against Odin's order, Thor travels to Jotunheim to confront Laufey, accompanied by his brother Loki, childhood friend Sif and the Warriors Three: Volstagg, Fandral, and Hogun. A battle ensues until Odin intervenes to save the Asgardians, destroying the fragile truce between the two races. For Thor's arrogance, Odin strips his son of his godly power and exiles him to Earth as a mortal, accompanied by his hammer Mjolnir, now protected by an enchantment that allows only the worthy to wield it.
Thor lands in New Mexico, where astrophysicist Dr. Jane Foster, her assistant Darcy Lewis, and mentor Dr. Erik Selvig, find him. The local populace finds Mjolnir, which S.H.I.E.L.D. agent Phil Coulson soon commandeers before forcibly acquiring Jane's data about the wormhole that delivered Thor to Earth. Thor, having discovered Mjolnir's nearby location, seeks to retrieve it from the facility that S.H.I.E.L.D. quickly constructed but he finds himself unable to lift it, and is captured. With Selvig's help, he is freed and resigns himself to exile on Earth as he develops a romance with Jane.
Loki discovers that he is actually Laufey's son, adopted by Odin after the war ended. A weary Odin falls into the deep "Odinsleep" to recover his strength. Loki seizes the throne in Odin's stead and offers Laufey the chance to kill Odin and retrieve the Casket. Sif and the Warriors Three, unhappy with Loki's rule, attempt to return Thor from exile, convincing Heimdall, gatekeeper of the Bifr st the means of traveling between worlds to allow them passage to Earth. Aware of their plan, Loki sends the Destroyer, a seemingly indestructible automaton, to pursue them and kill Thor. The warriors find Thor, but the Destroyer attacks and defeats them, prompting Thor to offer himself instead. Struck by the Destroyer and near death, Thor's sacrifice proves him worthy to wield Mjolnir. The hammer returns to him, restoring his powers and enabling him to defeat the Destroyer. Kissing Jane goodbye and vowing to return, he and his fellow Asgardians leave to confront Loki.
In Asgard, Loki betrays and kills Laufey, revealing his true plan to use Laufey's attempt on Odin's life as an excuse to destroy Jotunheim with the Bifr st Bridge, thus proving himself worthy to his adoptive father. Thor arrives and fights Loki before destroying the Bifr st Bridge to stop Loki's plan, stranding himself in Asgard. Odin awakens and prevents the brothers from falling into the abyss created in the wake of the bridge's destruction, but Loki allows himself to fall when Odin rejects his pleas for approval. Thor makes amends with Odin, admitting he is not ready to be king; while on Earth, Jane and her team search for a way to open a portal to Asgard.
In a post-credits scene, Selvig has been taken to a S.H.I.E.L.D. facility, where Nick Fury opens a briefcase and asks him to study a mysterious cube-shaped object, which Fury says may hold untold power. An invisible Loki prompts Selvig to agree, and he does.
Output: Who becomes king while Odin sleeps?