In the village of Bree, Gandalf the Grey meets with Thorin Oakenshield to help him plan a quest to retake Erebor. One year later, Thorin and his company of dwarves along with Gandalf and the hobbit, Bilbo Baggins, are being pursued by Azog and his Orc party following an attack at the Misty Mountains. They are ushered along by Gandalf to the nearby home of Beorn, a skin-changer who can take the form of the bear. That night, Azog is summoned to Dol Guldur by the Necromancer, who commands him to marshal his forces for war, so Azog delegates the hunt for Thorin to his spawn Bolg. The following day, Beorn escorts the company to the borders of Mirkwood, where Gandalf discovers Black Speech imprinted on an old ruin. Heeding a promise he made to Galadriel, he warns the company to remain on the path and leaves to investigate the tombs of the Nazgûl. Upon entering the forest, the dwarves lose their way and are ensnared by giant spiders. Bilbo sets about freeing them with the help of his recently acquired invisibility ring. He subsequently drops the ring and first begins to understand its dark influence after he brutally kills a creature to retrieve it.
The remaining spiders are fended off by the Wood-elves led by Tauriel and Legolas. They also capture the Dwarves and bring Thorin before their king Thranduil. Thranduil offers helps towards Thorin in exchange for starlight crystals in Erebor but Thorin confronts Thranduil about his neglect of the Dwarves of Erebor following Smaug’s attack 60 years earlier, and is consequently imprisoned with the other Dwarves. Bilbo, having avoided capture, arranges an escape using empty wine barrels that are sent downstream. While being pursued by the Wood-elves, they are ambushed by Bolg and his Orc party, and Kíli is wounded with a Morgul shaft. They engage in a running three-way battle down the river, but ultimately the Dwarves are able to escape both groups of pursuers. Thranduil then seals off his kingdom when an Orc captive reveals an evil entity has returned and is amassing an army in the south, but Tauriel decides to leave and assist the Dwarves, and Legolas goes after her. Meanwhile, Gandalf and Radagast go to investigate the tombs of the Nazgûl, which they find to be empty.
The company are smuggled into Esgaroth by a bargeman called Bard, but are discovered raiding the town armory for new weapons. Thorin promises the Master, his councilor Alfrid, and the people of Laketown a share of the mountain’s treasure, and it is revealed that Bard is a descendant of the last ruler of Dale, and possesses the last black arrow capable of killing Smaug. Kíli is forced to remain behind, tended to by Fíli, Óin, and Bofur, as the remaining company receive a grand farewell. Meanwhile, Gandalf travels south to the ruins of Dol Guldur, while Radagast leaves to warn Galadriel of their discovery at the tombs of the Nazgûl. Gandalf met Thrain, Thrain remembers he was captured and tortured by Azog. Gandalf finds the ruins infested with Orcs and is ambushed by Azog. Gandalf and Thrain make an escape attempt, but the Necromancer kills Thrain and overpowers Gandalf before revealing himself as Sauron.
Thorin and his remaining company reach the Lonely Mountain, where Bilbo discovers the hidden entrance. He is sent in to retrieve the Arkenstone, and while doing so, he accidentally awakens Smaug. While trying to find Bilbo, Smaug reveals his knowledge of Sauron’s return. Back in Laketown, Bard attempts to bring the black arrow to the town’s launcher, as he fears what may happen when the Dwarves enter the mountain. However, he is arrested by the Master and Alfrid in the process and leaves his son to hide the arrow. Bolg and his Orc party infiltrate the town and attack the four Dwarves, but are quickly dispatched by Tauriel and Legolas. Tauriel then tends to Kíli, while Legolas beats Bolg and leaves to pursue him. Meanwhile, Gandalf watches helplessly as Azog and an Orc army march from Dol Guldur towards the Lonely Mountain.
Back inside the mountain, during a long chase, Bilbo and the Dwarves rekindle the mountain’s forge using Smaug’s flames to create and melt a large golden statue of Thrór, hoping to bury Smaug alive in the molten gold. They do so, but Smaug emerges from the gold, storms out of the mountain and flies off to destroy Laketown, while Bilbo watches in horror.