The film opens with a ship sailing into the kingdom of Dor, known for its 'Royal Soup Day.' Roscuro (Dustin Hoffman), a rat, is aboard with a human companion, Pietro.
Roscuro is mesmerized by the aroma of soup being prepared in the castle's kitchens and he escapes Pietro to find the source. In doing so, he finds the castle banquet room and falls into the Queen's soup after she takes the first bite. The Queen then has a heart attack falls headfirst on her soup bowl and eventually drowns with no one noticing. Meanwhile, Roscuro is being chased about the castle. The chase finally ends when Roscuro falls into a vent and plunges into the dungeons.
The king in his grief orders soup to be forbidden and rats banished, and the town falls into eternal darkness and famine. Roscuro meanwhile, meets Botticelli (Ciaran Hinds), the brutal leader of the rat world.
A few years later, an adventurous mouse, Despereaux (Matthew Broderick) is born, and becomes friends with the lonely Princess Pea (Emma Watson). Upon finding out that Despereaux has broken the law by speaking with a human, the Mouse Council banishes him to the dungeons, from where he is saved by Roscuro. Despereaux tells Roscuro of the princess's gloom, which touches the rat.
Roscuro approaches the princess to apologize, but she is terrified of him and he is chased out. Hurt, he decides to kidnap the princess. He enlists the help of a servant girl, Miggery Sow (Tracey Ullman), whom he later double crosses, and locks in a cell.
Meanwhile, Despereaux realizes that the princess is in danger. Back in the rat colony, Roscuro sees the apologetic sincerity in Pea's eyes and regrets his actions, but is unable to stop the rats, to whom he has given her, from clambering over her. Here Despereaux comes to the rescue, letting loose a cat. Roscuro causes Botticelli to run into the cat's cage for a fatal end. The battle over, he finally apologizes, and is forgiven.
In the end, Mig is rescued by the jailer, who is revealed to be her father, and Roscuro is reunited with Pietro. The princess and the king decide to soothe their grief by relying on each other for support. Despereaux, reunited with his family, remains close friends with the princess.