In a flashback set in the town of Bree on the border of the Shire, Thorin Oakenshield (Richard Armitage
) arrives at the Prancing Pony, orders a meal, and notices that he's being watched. The watchers withdraw when Gandalf the Grey (Ian McKellen
) joins Thorin. Gandalf urges Thorin to begin a quest to obtain the Arkenstone. The stone will enable Thorin to reclaim the dwarves' lost kingdom of Erebor from the dragon Smaug and claim the throne of King under the Mountain. Gandalf suggests recruiting a burglar to steal the Arkenstone from the dragon-guarded mountain.
Twelve months later, not long after the end of the previous film, Bilbo (Martin Freeman
), Gandalf, Thorin and the dwarven company are chased by the orcs down from the Carrock, where they encounter a huge and ferocious bear. Gandalf urges the company to seek refuge in a nearby house. They make it there just barely ahead of the bear -- which, once the doors are safely barred, Gandalf reveals to be their host, Beorn (Mikael Persbrandt
), a skin-changer who can take the form of a man or a bear. Remarking that he dislikes dwarves but hates orcs much more (they hunted and tortured his kind for centuries, and Beorn is the last of them), Beorn loans his horses to the company so that they can outrun the pursuing orcs.
Azog (Manu Bennett
), the leader of the orcs, is summoned to Dol Guldur where he is given command of the armies by the Necromancer (voice: Benedict Cumberbatch
). Azog gives his son, Bolg (Lawrence Makoare
), the task of hunting the dwarves.
Gandalf departs as the others enter Mirkwood, urging Bilbo and the dwarves not to stray from the forest path and to wait for him before entering the mountain. After losing their way because of the evil enchantments that make the forest so dangerous, the dwarves are captured by giant spiders while Bilbo climbs a tree to get their bearings. Bilbo, with the help of his sword (which he names Sting during this encounter) and the One Ring, manages to free them from the webs of the spiders. However, while fighting the attacking spiders, the dwarves are captured by Wood-elves led by Tauriel (Evangeline Lilly
) and Legolas (Orlando Bloom
), the son of the Elven King Thranduil (Lee Pace
). Thorin holds a grudge against Thranduil for refusing the help the dwarves after the dragon drove them out of the Lonely Mountain, and he refuses to negotiate. Thus he and the other dwarves are locked up. Bilbo, however, uses his ring to escape the elves' notice and follows the prisoners to their dungeon.
Kili (Aidan Turner
) falls for Tauriel, who seems intrigued by him. Legolas is also sweet on Tauriel, but she's been told by King Thranduil to discourage him; Legolas is not for the likes of her.
Under the cloak of his ring, Bilbo steals the jailer's keys and helps the dwarves to escape from the halls of the Wood Elves using empty wine barrels, in which they float down the river. Along the way, they are attacked by Bolg and his band of orcs, who had been lying in wait. When Kili tries to open the river gate, Bolg wounds him with a poisoned arrow. Tauriel and Legolas, sent to chase down the escaping dwarves, end up helping them fend off the orcs.
Several miles downriver, Bilbo and the company meet Bard (Luke Evans
), a bowman and descendant of the original lord of Dale, who was waiting to collect the empty barrels in his barge. They pool their coins to bribe Bard to smuggle them into Lake-town (Esgaroth). Using the barrels the company used to escape the elves, Bard covers the dwarves and Bilbo with a load of fish. When he's stopped at the main gate, Alfrid (Ryan Gage
), assistant to the town's Master, stops him, nitpicking that the barrels are supposed to be empty and the contents will be dumped into the lake. Bard argues that the town needs the fish for food and Alfrid lets him go, warning him that he knows where Bard lives & he's being watched. Bard replies that the town is small & "everyone knows where everyone lives."
Bard sneaks the dwarves past the town's extensive spy network and they enter his house through the toilet undetected. The dwarves scoff at the makeshift weapons Bard provides and consequently are captured trying to steal better weapons from the town armory. They're taken before the Master of Lake-town (Stephen Fry
), where Thorin convinces the townsfolk and the Master that the dwarves will share the riches of the recaptured mountain with Lake-town. The adventurers receive a grand send-off, but Thorin makes Kili stay behind because his wound is slowing him down -- in fact, it's getting worse. Oin (John Callen
) and Kili's brother Fili (Dean O'Gorman
) stay with him. Bofur (James Nesbitt
) stays too because he passed out under the table during the feast and misses the boat.
Meanwhile, the Elvenking learns from a captured orc that Sauron has returned, and decides to seal off the Elf kingdom in Mirkwood to protect it from the impending evil. However, Tauriel leaves to help the injured Kili and a concerned Legolas gives chase.
The remainder of Thorin's company make their way to Erebor and search for the cliff that houses Durin's Door. In a sheltered nook, they find the spot shown on the map and try to locate the keyhole. When they can't find it, they try to bludgeon their way in and are defeated. Hopeless, they leave in frustration, knowing that the sun has set on Durin's Day, the last day of Fall. However, a few moments later, Bilbo deciphers the clue on Thorin's map about the last light of Durin's Day; moonlight shines on the keyhole and Bilbo excitedly calls them back. Thorin unlocks the secret door into the mountain. Thorin is overcome with emotion at the sight of his old home and sends Bilbo in to find the Arkenstone. Balin (Ken Stott
) warns Bilbo not to wake the dragon.
Bilbo sneaks down the tunnel and attempts to steal the Arkenstone, but Smaug (voice: Benedict Cumberbatch
) wakes up and discovers him. Bilbo slips on the ring, becoming invisible. Though Smaug is fearsome, Bilbo stands his ground and placates the dragon. Smaug is flattered but still furious that anyone would challenge the sanctity of his dwelling. Smaug continues to question Bilbo, gaining further clues to his intruder's identity. Eventually, Bilbo spots the Arkenstone but is unable to take it. Smaug wants Bilbo to steal it -- the dragon knows that Thorin will fall under the same influence as his grandfather and be overcome by greed. As the dragon passes over Bilbo, the hobbit spies the bare spot on Smaug's chest where the black arrow shot by Bard's ancestor knocked a scale loose.
At the same time, Gandalf, after sending Radagast away with a message for Galadriel, knowingly steps into the orc-ambushed Dol Guldur and engages Azog, his band of orcs, and the Necromancer in a fierce battle. During the battle, the Necromancer appears to Gandalf as the Eye of Sauron, revealing his true identity. The battle ends with Gandalf's capture.
Tauriel and Legolas arrive at Lake-town in the nick of time to fight off the orcs, who have tracked the dwarves to Bard's house. Legolas goes off after Bolg, sparring with him on the floating byways of Lake-town before embarking on a mounted pursuit on land. Tauriel attends to the wounded Kili using her healing magic and some kingsfoil that Bofur scrounged out of a pigsty. Sensing that the dragon is coming, Bard sets off to load the last Black Arrow into the town's Windlance (a large crossbow mounted on a tower) so that it can pierce the weakened spot in the dragon's armor. (The weak spot is a missing scale, courtesy of Bard's ancestor Girion, last lord of Dale.) Bard is captured by the Master's men, but not before handing off the Black Arrow to his son Bain (John Bell
), who hides it in a small boat.
The dwarves enter the mountain to help Bilbo. An infuriated Smaug chases them through the caverns. When Thorin and the company enter an isolated room, they find the last of Thror's folk lying dead, trapped by Smaug many years before -- they subsequently starved to death. Thorin refuses to surrender and thinks of a new plan to trick Smaug into rekindling the forge using his fiery breath. The gold in the furnaces melts and is set loose, flowing down a series of channels and into a giant mold of a dwarven king. Smaug, having deciphered a clue of Bilbo's, "barrel-rider", sets out to burn Lake-town in revenge. He is stopped when he sees Thorin atop the giant mold. The sides of the mold are cut loose and the solid gold statue that had formed suddenly collapses and covers Smaug with molten gold. However, Smaug bursts out, breaking free of the main gate and takes to the air, shaking off the gold coating. Bilbo watches Smaug fly off into the night to wreak havoc on Esgaroth and says "What have we done?"