In Medieval Scotland, Princess Merida of the clan Dunbroch is given a bow and arrow by her father, King Fergus, for her sixth birthday to the dismay of her mother, Queen Elinor. While venturing into the woods to fetch a stray arrow, Merida encounters a will-o'-the-wisp. Soon afterward, Mor'du, a huge demon bear, attacks the family. Merida flees on horseback with Elinor, while Fergus and his men fend off Mor'du, though the fight costs him one of his legs.
Ten years later, Merida is told that she is to be betrothed to the son of one of her father's allies. Elinor explains that failure to consent to the betrothal could harm Dunbroch, reminding Merida of a legend of a prince whose pride and refusal to follow his father's wishes destroyed his kingdom.
The allied clan chieftains and their first-born sons arrive to compete in the Highland games for Merida's hand in marriage. Merida twists the rules, announcing that as her own clan's firstborn she is eligible to compete for her own hand. She easily bests her suitors in an archery contest, shaming the other clans, and after a heated argument with Elinor, runs away into the forest. Wisps appear, leading her to the hut of an elderly witch. Merida bargains for a spell to change her fate, and the witch gives her an enchanted cake.
When Merida gives Elinor the cake, it transforms her into a bear, unable to speak but still retaining most of her human consciousness. Merida returns to the witch's cottage with Elinor, only to find it deserted, and discovers a message from the witch: unless Merida is able to "mend the bond torn by pride" before the second sunrise, the spell will become permanent. Merida and Elinor are led by the wisps to ancient ruins, where they encounter Mor'du. Realizing that Mor'du was the prince in the legend, Merida vows that she will not let the same thing happen to her mother, and concludes she needs to repair the family tapestry she damaged during their argument.
They return to the castle to find the clans on the verge of war. Merida intends to relent and declare herself ready to choose a suitor as tradition demands, but Elinor prompts her instead to insist that the firstborns should be allowed to marry in their own time to whomever they choose. The clans agree, breaking tradition but renewing and strengthening their alliance.
Merida sneaks into the tapestry room with Elinor. Elinor, who is losing her humanity, attacks Fergus, but suddenly regains her composure and flees the castle. Mistaking the queen for Mor'du and unwilling to listen to Merida, Fergus pursues the bear with the other clans, locking Merida in the castle. Merida escapes and repairs the tapestry while riding after her father. Fergus and the clans capture Elinor, but Merida intervenes and stops her father before Mor'du arrives. Mor'du batters the clan warriors and targets Merida, but Elinor intercedes, holding off Mor'du and causing him to be crushed by a falling menhir. This releases the spirit of the prince, who silently thanks Merida for freeing him. Merida covers her mother in the repaired tapestry, but she remains a bear. As the sun rises for the second time, Merida realizes the mistakes she has made and reconciles with Elinor, unknowingly fulfilling the true meaning of the witch's message and reversing the spell's effects.
With Mor'du gone, Merida and Elinor work together on a new tapestry when they are called to the docks to bid farewell to the other clans, and ride their horses.