Harry is back at the Dursleys for the summer holidays, where he sees on Muggle television that a convict named Sirius Black has escaped, though with no mention of what facility he has broken out of. Harry involuntarily inflates Aunt Marge when she comes to visit after she insults Harry and his parents. This leads to his running away and being picked up by the Knight Bus. He travels to the Leaky Cauldron where he meets Cornelius Fudge, the Minister for Magic, who asks Harry to stay in Diagon Alley for the remaining three weeks before the start of the school year at Hogwarts.
The night before Harry is expected to leave for Hogwarts, he learns from Arthur Weasley that Sirius Black is a convicted murderer in the wizarding world, and he warns Harry that it is believed Black will attempt to murder Harry next. On the way to Hogwarts a Dementor boards the train, causing Harry to faint. Following the incident, Harry is helped by the new Defence Against the Dark Arts teacher Remus Lupin. Harry, Ron, and Hermione learn that the Dementors will be patrolling the school in an attempt to catch Black.
Later on, Lupin's Defence Against the Dark Arts sessions prove far better than those of Gilderoy Lockhart's (Harry's uselessly vain ex-teacher). They have a fun lesson on Boggarts and then learn about more Dark Creatures. When Lupin supposedly falls ill, the much hated Potions Master Professor Snape temporarily takes over teaching Defence Against the Dark Arts and torments the class, much to their dismay.
At Hogwarts, Harry has several problems with the Dementors, including an episode at a Quidditch match during which he faints and falls off his broomstick from high in the air. His broom is blown away and smashed by the Whomping Willow. Working with Harry outside class, Lupin teaches him the Patronus Charm to repel Dementors.
On an unauthorised visit to the village of Hogsmeade (thanks to The Marauder's Map, given to him by George Weasley and Fred Weasley), Harry overhears some of his teachers talking with Fudge about Black. They reveal that Black was a friend of Harry's parents but he betrayed them and gave Voldemort access to their house. They also mention that Black killed twelve Muggles and his former friend Peter Pettigrew.
Ron and Hermione's friendship later suffers when Ron believes that Hermione's cat, Crookshanks, ate his rat, Scabbers. At Christmas Harry receives a mysterious present, a late-model Firebolt broom. Fearing it might be cursed, Hermione reports the gift to Professor McGonagall, which leads to more bad feelings between her and Ron and Harry.
Ron, Hermione, and Harry join the effort to save Hagrid's hippogriff, Buckbeak, from being executed for attacking Draco Malfoy, after Draco provoked him. Their efforts are unsuccessful, but Scabbers reappears shortly after they hear Buckbeak being executed.
Ron chases Scabbers, only to be attacked by a big black dog, which Harry has seen several times before. The dog drags Ron through a tunnel under the Whomping Willow into the Shrieking Shack. Harry and Hermione follow, and there is a brief standoff when they find Ron with Sirius Black, who has transformed from the dog. Lupin enters, and they explain the situation to Harry and his friends: Lupin is a werewolf, which led to his friends James Potter, Sirius Black, and Peter Pettigrew becoming animagi. Lupin explains that Scabbers is Pettigrew in his animal form; he has been hiding from Black, whom he had framed for betraying Harry's parents and murdering the thirteen Muggles.
Snape arrives to apprehend Black but Harry, Ron, and Hermione knock him unconscious. Lupin and Black transform Pettigrew back into human form and prepare to kill him, but they are stopped by Harry, as he feels his father would not have wanted it. He convinces them to send Pettigrew to Azkaban instead.
As they move back toward Hogwarts, Lupin turns into a werewolf and becomes violent, having missed a dose of his Wolfsbane potion. Pettigrew escapes again, and Black prevents Lupin from attacking the others in werewolf form. Some Dementors approach Harry, Ron and Hermione.
When they wake up in the hospital, Harry, Ron, and Hermione are told that Black has been sentenced to receive the Dementor's kiss, which removes the soul of the recipient. Dumbledore advises Hermione and Harry to use Hermione's time-turner, a device she has been using to double-up on classes; this permits them to go back in time and save Buckbeak, who carries Black away to safety.
Sadly, Snape lets slip that Lupin is a werewolf, leading to his resignation. Harry visits Lupin before he leaves, and as they say goodbye, Lupin is certain that they will meet again.