Justin (Freddie Highmore) lives in the kingdom of Gabylonia, where lawyers control everything and knights have been ousted. His dream is to become one of the Knights of Valour, like his grandfather, Sir Roland. But his father Reginald (Alfred Molina), a widower and the chief counsel to the Queen (Olivia Williams), wants his son to follow in his footsteps and become a lawyer. After an argument with his father, Justin seeks comfort from his grandmother (Julie Walters), a friend of the Queen, who encourages him to follow his dreams. Justin notices that his grandfather’s sword is missing and decides to find the sword as his knights quest. His grandmother gives him a key which originally belonged to his grandfather and tells him to go to an abbey where three wise monks would train him. Before Justin leaves on his quest, he visits his crush Lara (Tamsin Egerton) who is a spoilt brat and the daughter of the kingdom’s greatest businessman. He says farewell to her, though she is not really listening and rather uncaringly gives him a sock as a token.
Justin embarks on his quest to become a knight. Along the way he meets a beautiful, feisty girl named Talia (Saoirse Ronan), a barmaid who works at the Broken Eagle Inn, a job which she doesn’t enjoy, and a quirky wizard called Melquiades (David Walliams). Talia is immediately enamored by Justin, which Melquiades notices. Meanwhile, Justin’s grandmother visits the Queen, who tells her that she regrets her decision of ousting the knights. An armor polisher and small-time thief overhears their conversation and steals some armour to disguise himself as a knight, naming himself Sir Clorex (Antonio Banderas). He instantly becomes popular with the townsfolk and is used to attract customers at the Broken Eagle Inn, but Talia is immediately able to tell that he is a phony.