Five years after the Viking village of Berk has made peace with the dragons, dragons now live amongst the villagers as working animals and companions, and even take part in racing sports. Hiccup goes on adventures with his dragon, Toothless, as they discover and map unexplored lands and territories. Having come of age, he is being pressed by his father, Stoick the Vast, to succeed him as chieftain, although Hiccup remains unsure if he is ready for this responsibility.
While investigating a wildfire, Hiccup and Astrid discover the remains of a fort encased in a colossal blue ice formation and encounter a dragon trapper named Eret, who blames them for the destruction of his fort and attempts to capture their dragons for an insane conqueror called Drago Bludvist. The two riders return to Berk to warn Stoick about the dragon army that Drago is amassing, and Stoick orders the villagers to fortify the island and prepare for battle. Stoick explains that he once met Drago at a gathering of chiefs and found him to be an unreasonable madman, but Hiccup refuses to believe that war is inevitable. After Stoick interrupts their plan to get Eret to take them to his master, Hiccup flies off with Toothless in search of Drago, to try and reason with him.
They are captured by a dragon rider named Valka, who is revealed to be Hiccup's long lost mother. She explains that she spent twenty years rescuing dragons from Drago's traps and bringing them to an island haven created out of ice by a colossal Alpha dragon called a Bewilderbeast, to whom all dragons answer. Stoick tracks Hiccup to the island where he discovers that his wife is still alive. Simultaneously, Astrid and the other riders kidnap Eret to find Drago, but they are also captured and Drago learns of Berk's dragons.
Drago and his army lay siege to Valka's sanctuary, where he reveals that he has his own Bewilderbeast to challenge the Alpha. A titanic battle ensues between the two Bewilderbeasts in a fight for control over all dragons on the island. Drago's Bewilderbeast emerges victorious by killing the Alpha and seizes control of all the dragons, including Toothless, using a strange form of dragon hypnotism attributed only to the Alpha. Hiccup tries to persuade Drago to end the violence, but Drago orders him killed as well. Toothless, under the influence of the new Alpha, approaches Hiccup and fires a plasma blast. At the last instant, Stoick pushes Hiccup out of the way, and is hit instead, killing him instantly. Hiccup angrily drives Toothless away when he approaches Stoick's body after the Alpha relinquishes control over him. Drago leaves Hiccup to his fate and, riding Toothless, again under the control of the Alpha, leads his now larger army to destroy Berk. Stoick is given a Viking funeral and Hiccup, now filled with regret at the loss of his father and his dragon, decides that he will fly back to Berk to defend his people and live up to his father's legacy.
The dragon riders and Eret ride baby dragons, which are immune to the Alpha's control, and arrive at Berk after the Alpha had already attacked the village and taken control of the dragons there. Hiccup confronts Drago and a brainwashed Toothless while the other riders work to distract the Bewilderbeast. Drago again orders the Alpha to make Toothless kill Hiccup, but Hiccup succeeds in disenchanting Toothless. Drago then orders the Alpha to shoot the pair, and the Bewilderbeast successfully encases them in a large blast of ice, seemingly killing them. His victory is short-lived, as Toothless, now glowing with plasma, blasts away the ice, revealing that both he and Hiccup are unharmed. Toothless challenges the Alpha and repeatedly fires plasma blasts at the Bewilderbeast. This frees the other dragons from the Bewilderbeast's control and all fire at it, severely injuring the colossal dragon until Toothless fires a final massive blast, breaking its left tusk.
Defeated,his Bewilderbeast kills Drago and retreat into the ocean from him as the vikings celebrate their victory. All the dragons now acknowledge Toothless as the new Alpha dragon, and Hiccup is made chief of Berk by the village elder. The film ends with Berk being rebuilt with a statue of Stoick erected in his honor, and Hiccup doing his duties as chief, proudly declaring that while others may have armies and armadas, Berk has its own dragons.