In Britain 740 AD, Merlin has three apprentices; Balthazar Blake, Veronica Gorloisen, and Maxim Horvath. Horvath betrays Merlin by allying with the evil sorceress Morgana le Fay. Morgana mortally wounds Merlin before Veronica rips Morgana's soul from her body and absorbs it into her own. As Morgana attempts to kill Veronica from within, Balthazar stops her by imprisoning Morgana and Veronica in the "Grimhold", a magic prison in the shape of a nesting doll. Before dying, Merlin gives Balthazar a dragon figurine that will identify the Prime Merlinean, Merlin's descendant and the only one able to defeat Morgana. While searching for his descendant throughout history, Balthazar imprisons Morganians, sorcerers who try to release Morgana, including Horvath, into successive layers on the Grimhold.
In 2000, in New York City, a 10-year-old Dave Stutler encounters Balthazar in his Manhattan antique store. When Balthazar gives Dave Merlin's dragon figurine, the statue comes to life and wraps itself around the boy's finger to form a ring, revealing his status as the Prime Merlinean. While Balthazar retrieves a book meant to teach magic, Dave accidentally opens the Grimhold, releasing the imprisoned Horvath. While battling for possession of the Grimhold, Balthazar and Horvath are imprisoned in an ancient Chinese urn with a ten-year lock curse while Dave flees with the ring.
Ten years later, Dave is a physics student at New York University. The ten-year imprisonment curse of the urn ends, releasing Horvath and Balthazar. Horvath pursues Dave and the Grimhold. Balthazar rescues Dave, riding an animated steel eagle adapted from a Chrysler Building gargoyle. Dave refuses to help Balthazar, having been under psychiatric care since their first meeting, until Balthazar agrees to leave after finding the Grimhold. They track the Grimhold to Chinatown, where Horvath has released the next Morganian, Sun Lok. Dave defeats Sun Lok, and Balthazar retrieves the Grimhold. Dave changes his mind and agrees to become Balthazar's apprentice. He also becomes romantically involved with his childhood crush, Becky, against Balthazar's wishes and advice.
Horvath enlists a youthful Morganian, celebrity magician Drake Stone, to get the Grimhold. They attempt to kill Dave, but Balthazar saves him. Cued by Horvath, Dave demands to know the truth about Balthazar's quest. Balthazar reveals that Morgana is trapped in the Grimhold with Veronica. Morgana, if freed, would cast a spell called "The Rising", which would revive sorcerers from the dead and enslave mankind. As Prime Merlinian, Dave is the only one who can stop her.
Despite Balthazar's disdain for his relationship with Becky, Dave convinces him to allow him to meet her for a date. Dave tries to use magic to clean his lab but loses control of his animated cleaning mops, which forces him to cancel his date with Becky. He is saved because of Balthazar's intervention and gives up on magic until Becky unknowingly changes his mind. He returns to his underground subway lab, just as Drake and Horvath steal the Grimhold. Horvath, having no more use for Drake, steals Drake's magic.
Horvath releases the witch Abigail Williams, using her to kidnap Becky at the radio station, and then steals her magic. He threatens to kill Becky, forcing Dave to surrender the Grimhold and his ring. Without the ring, Dave has no conduit to use his magic, so Balthazar goes after Horvath in Battery Park. Horvath releases Morgana, who begins the Rising Spell while Horvath animates the Charging Bull sculpture and commands it to attack Balthazar. Dave arrives and stuns Horvath with a Tesla coil tied to Balthazar's car while Balthazar's eagle flies away with the bull. Becky disrupts the Rising Spell, stunning Morgana.
Balthazar takes Morgana, body and soul, from Veronica into himself, but Morgana escapes and tries to incinerate them. Dave succeeds in stopping her without his ring. Morgana overwhelms Balthazar and Veronica's shield spells, killing Balthazar when he intercepts a bolt meant for Veronica. Dave makes another, larger Tesla coil out of the square's lamp posts and power lines to stun her and then fires a plasma barrage, which finally destroys her. He revives Balthazar by restarting his heart with plasma shocks, and Balthazar reunites with Veronica. Dave and Becky fly to France for breakfast on Balthazar's eagle.