The story is set in the village of Gavaldon, where two children disappear every four years, never to return. The children of the village have realized that those that disappear eventually turn up in the fairy tales sold at the local book store, each child appearing as either a 'Hero' or a 'Villain'.
The two protagonists, Agatha and Sophie, are best friends and a perfect fit for these tropes. Sophie hopes to be carried off the the legendary 'school for good', where she can become a princess, however Agatha wants nothing to do with the 'school for evil'.
The two girls are kidnapped, however Sophie ends up being sent to the school for evil and Agatha to the school for good, the opposite of what they expected. During their lessons neither of them fits in, however they have no choice but to continue and no hope of escape.
In the course of lessons and events where the two schools mix, Sophie and Agatha fall apart, but Sophie begins to fall in love with one of the Princes of the school of good, Tedros.
The two girls break into the school master's tower in an attempt to get back home and are given a riddle. Agatha believes that the answer to the riddle is love and tries to help Sophie and Tedros fall in love by convincing him that Sophie was put in the wrong school.
Sophie and Tedros begin to have problems and a fight breaks out between the two schools, instigated by Sophie, who is turning uglier and uglier with each horrid act. As evil begins to fill her, she has dreams that reveal that Agatha is the enemy she is destined to fight in her fairy tale.
Sophie decides to break into the school masters tower again in order to steal his Storian, a magical item he uses to write the fairy tale. He tells her that he is in love with her and she attempts to kiss him, only to realize that as a villain she is incapable of true love, causing the school master to begins to rot. In order to be with Sophie the school master tries to kill Agatha, but Sophie attempts to save her friends and is killed in the proses. The school masters brother appears to defeat him but he cannot save Sophie.
Agatha kisses Sophie to say good bye, yet because she had a pure, heroic love for Sophie, she brings her back to life.