The third Hobbit film picks up shortly after the second left off. The people of Lake-town are in a panicked frenzy as the dragon Smaug (voice: Benedict Cumberbatch) flies down to exact his revenge. The Master of Lake-town (Stephen Fry) and his deputy Alfrid (Ryan Gage) try to evacuate with the town's treasure while the rest of the townsfolk also try to escape. Smaug descends and breathes fire all over the town, destroying a whole row of houses and killing many people.Meanwhile, Bard the bowman (Luke Evans) tries to break free from his cell while his children are leaving with Tauriel (Evangeline Lilly), Kili (Aidan Turner), Fili (Dean O'Gorman), Bofur (James Nesbitt), and Oin (John Callen). On the boat, Bard's son Bain (John Bell) sees his father as he climbs the bell tower to get high enough to shoot at Smaug. Before he was captured in the previous movie, Bard told Bain to hide the last Black Arrow. Realizing that Bard needs the arrow, Bain grabs a cargo hook, swings out of the boat, and goes to retrieve the Black Arrow from the small boat where he left it hidden.From atop the Lonely Mountain, Bilbo Baggins (Martin Freeman), Dwalin (Graham McTavish), Balin (Ken Stott), Dori (Mark Hadlow), Nori (Jed Brophy), Ori (Adam Brown), Bifur (William Kircher), Gloin (Peter Hambleton), and Bombur (Stephen Hunter) watch as the dragon terrorizes Lake-town. Their leader Thorin Oakenshield (Richard Armitage) is unable to watch with them.Bard shoots his arrows at Smaug as the dragon flies by, but they are unable to penetrate his scaled hide. Bain arrives with the Black Arrow, which is big enough to do the job. Smaug taunts Bard and his son as Bard aims the black arrow while balancing it on Bain's shoulder. As Smaug flies toward them, Bard shoots the arrow. It strikes the dragon, hitting the weak spot in his armor. He screams in pain as the light leaves his body. Smaug plummets into the lake, where his body crushes the Master and the gold supply. The dwarves see that Smaug is dead and they rejoice.The surviving people of Lake-town gather the supplies they have left. Alfrid tries to swipe some, but Bard stops him. The people recognize Bard as their savior for killing Smaug. They grab Alfrid and try to punish him, but Bard stops them. He decides they will take refuge in the town of Dale.Kili and the other dwarves leave for the mountain to rejoin the rest of the company. Kili asks Tauriel to join him. Legolas (Orlando Bloom) cuts in and tells Tauriel to say goodbye to Kili. Kili hands her the carved stone that he showed her when they first met.In the Lonely Mountain, the dwarves return to Bilbo, who tells them that Thorin has started to lose his mind after being corrupted by the hoarded gold in the mountain. He is also going mad in his search for the Arkenstone. It turns out that Bilbo had it all along, but heeded Smaug's warning that the stone would drive Thorin mad. Bilbo goes to Balin and asks about the Arkenstone without admitting he has it; Balin says possessing the stone might make Thorin even more irrational.The orcs and their leader Azog (Manu Bennett) are marching toward Erebor when Bolg (John Tui) arrives to inform Azog that the Elf army is approaching closely. Azog orders Bolg to go to Gundabad, an Orc stronghold, to rally a greater army of Orcs to join them.In Dol Goldur, Gandalf (Ian McKellen) is still caged after learning that the Necromancer (voice: Benedict Cumberbatch) was Sauron. A giant Orc threatens him until Galadriel (Cate Blanchett) arrives and vanquishes it. Then the Nazgul (nine ghost-like men who fell victim to Sauron) show up to attack, but Elrond (Hugo Weaving) and Saruman (Christopher Lee) come in to fight them. The two of them defeat the Nazgul as Galadriel tends to Gandalf. Radagast (Sylvester McCoy) comes back in his rabbit-drawn sleigh to take Gandalf away. The image of Sauron appears and tries to tempt Galadriel, but she overpowers him and casts him out. She falls in a weakened state. Elrond suggests they warn everyone of Sauron, but Saruman tells them to help Galadriel and says they can leave Sauron to him.Legolas and Tauriel learn that Bolg is going to Gundabad. They decide to follow him after learning from a messenger that Tauriel has been banished from the Elf kingdom by Thranduil (Lee Pace).Thranduil arrives in Dale with his army close by. He speaks to Bard about forming an alliance, as Thranduil wants to get into the Lonely Mountain to reclaim some white gems, including a necklace made of them.Bard rides over to the Lonely Mountain's main gate, hoping to persuade Thorin to join forces with him to avoid any more bloodshed. Thorin refuses to listen or to give away any part of his treasure, despite his promises when the people of Lake-town helped the dwarves. Bard leaves angrily.The dwarves suit up in their armor to prepare for battle. Thorin gives Bilbo a shirt of mithril mail that he says is so strong that no blade can pierce it. As they speak, Thorin continues to sound distorted and dazed as he vows not to share the treasure.Gandalf arrives in Dale, and Bilbo sneaks out of the mountain at night to a tent where Gandalf, Bard, and Thranduil are talking. Bilbo gives them the Arkenstone, claiming it as his share of Thorin's treasure. Thranduil tells Gandalf that he will finish this fight to protect his people.The next day, the Elvish and Lake-town armies stand before Erebor. Thorin and the dwarves come out on the wall. Bard displays the Arkenstone to offer in trade for the gold. Thorin thinks it's a trick until Bilbo admits that he gave it to them. Feeling betrayed, Thorin orders the Dwarves to throw Bilbo over the edge. They refuse, and Thorin nearly does it himself. Gandalf arrives to stop this, allowing Bilbo to escape and join his wizard friend. Bard asks Thorin if he will have peace or war, and Thorin growls that he will have war. Then, an army of Dwarves led by Thorin's cousin Dain Ironfoot (Billy Connolly) arrives to help Thorin and his company. They are on the verge of attacking the Elf army when the Orc army shows up. The armies of dwarves, elves, and humans join together to fight the villains, and the Battle of the Five Armies begins!Legolas and Tauriel get to Gundabad and discover Bolg summoning the rest of the Orc forces, along with a horde of giant bat creatures.In the mountain, Dwalin attempts to reason with Thorin, who seems more disillusioned and angry. Thorin threatens to kill him if he does not leave. Dwalin does so, disappointed. Thorin goes down to the Gallery of Kings and walks over the hardened gold where he had tried to trap Smaug. He hallucinates seeing the dragon swimming beneath him, as well as himself sinking into the gold. Thorin snaps out of it and overcomes his madness. Using a giant bell as a wrecking ball, the Dwarves smash through the wall they built across the gate into the mountain and emerge to join the fight.Bard sends the women and children to safety while the men fight. He hands Alfrid a sword, but the coward is more concerned about staying hidden and getting some treasure. Meanwhile, many innocent civilians are slaughtered in the battle.With Dwalin, Fili, and Kili ("his best warriors," Gandalf says), Thorin resolves to ride to the top of Ravenhill, the orcs' command post, and kill Azog. He knows that the loss of their leader will make it possible to defeat the orcs. Elsewhere, Legolas and Tauriel return. Thranduil finds Tauriel going off to help the Dwarves and warn them of Bolg's army, but Thranduil doesn't think they are worth it and believes her love for Kili isn't real. Tauriel holds her bow and arrow to Thranduil, but he cuts it up. Legolas stands in the way to defend her. They join forces with Bilbo, who made it through the battle with the One Ring, and go off to warn their friends.The heroes find the Orcs, but in the chaos, Bilbo is knocked unconscious while Fili is impaled by Azog. Enraged, Kili runs to the top of the tower, decapitating every Orc in his path. He comes before Bolg as Tauriel joins in the fight. Bolg overpowers her and throws her against the wall. Kili comes to her defense, but Bolg stabs him through the heart. Tauriel watches him die. In her fury, she grabs onto Bolg and pulls him down the edge of a precipice. Legolas watches from a distance and gropes for an arrow, but he's all out. He gets a giant Orc to ram a tower that falls and forms a bridge, letting him run to Tauriel's aid. He battles Bolg on the crumbling tower, adroitly running up cascades of falling debris. From atop on the icy falls, he sees Thorin, weaponless, nearly killed by an Orc, so Legolas throws his sword into the Orc's chest. (Thorin retrieves the sword from the body and continues to fight with it.) Legolas takes out his knives and drives one into Bolg's head. The Orc falls through the tower, which crumbles completely. He hits the ground and is crushed by a piece of the tower.Radagast and Beorn (Mikael Persbrandt) swoop in on the Great Eagles as they take down the rest of the Orcs. Beorn morphs into his bear form and runs the Orcs down.Thorin battles Azog on a frozen pool above the icy falls. Azog swings his chained boulder to try and slam Thorin, only to break the ice around him. Thorn grabs the boulder and throws it to Azog, causing him to sink into the water. Thorin watches Azog float by him beneath the ice, seemingly dead, until the Orc opens his eyes, stabs Thorin in the foot, and bursts through the ice. He pins Thorin down and tries to impale him, but Thorin holds him back. However, realizing the Orc is too strong, Thorin lets Azog impale him, until he has a clear moment to kill the orc: Thorin drives his sword through Azog's body into the ice as the Orc finally dies.Thorin walks over to watch the rest of the battle. He collapses as Bilbo comes by his side. Thorin says he is sorry to Bilbo for how he acted and for what he's put him through. He acknowledges Bilbo's friendship before he dies. Bilbo weeps for his fallen friend. The surviving Dwarves come and kneel beside Thorin.Legolas tells Thranduil that he is leaving the kingdom. Thranduil tells his son to look for one of the Dunedain, a man who is referred to as Strider (Aragorn). After Legolas leaves, Thranduil finds Tauriel crying over Kili's body. She rejects love and asks why it hurts so much. Thranduil responds, "Because it was real." Tauriel kisses Kili's lips and plans to properly bury him.Bilbo leaves the mountain and tells Balin to tell the Dwarves goodbye for him. He turns around to find them standing behind him. Bilbo properly bids them farewell and invites them to come by his home should they ever find themselves traveling toward Bag End.Gandalf guides Bilbo back to the borders of the Shire. He knows that Bilbo had the ring with him, but Bilbo claims he lost it. Gandalf provides him with a word of caution before they depart. When Bilbo gets close to Bag End, he sees people walking off with his belongings. Since he was presumed dead, his belongings are being auctioned off. He demands to have them back while trying to find something that proves his identity. He goes inside his hole and takes out the ring.The final scene shows the older Bilbo (Ian Holm) holding the ring in his hand. There's a knock at the door. Bilbo says he wants no visitors, but jumps up when he hears Gandalf's voice. He goes to the door to greet his old friend, and the last thing we see is Thorin's map of Erebor (thus beginning the very first scene of the second Middle Earth trilogy of The Lord of the Rings).