At the beginning of August, after a month of no meaningful contact from anyone in the Wizarding world, two dementors attack Harry and his cousin Dudley in an alley. Harry discovers that his neighbor, Mrs. Figg, is a Squib (someone born to a magical family but who can’t use magic), and that Dumbledore has been having people watch him. Uncle Vernon and Aunt Petunia try to kick Harry out as Harry receives a letter calling him to a hearing. When Petunia receives a Howler (an angry, literally explosive letter) with a cryptic message, she insists that Harry has to stay. Three days later, a dozen witches and wizards, including Mad-Eye Moody and Remus Lupin, come to rescue him. Together, they fly to number twelve, Grimmauld Place in London. There Harry reunites with Hermione and Ron and immediately shouts at them about feeling neglected. Hermione and Ron insist that Dumbledore swore them to secrecy and they don't know much. Later, Sirius and Mr. Weasley sit Harry down to fill him in. They tell him that they're trying to spread the news that Voldemort is back and say that Voldemort is after some sort of weapon.
Harry spends the next week helping to clean the house, which belonged to Sirius's parents. The Blacks thought Voldemort was right in his ideas, and their ancient house-elf, Kreacher, mutters rude slurs to himself. On the morning of Harry's hearing, he goes to the Ministry with Mr. Weasley and learns that the place and time of his hearing changed, and he's already late. Though Dumbledore steps in and saves Harry from expulsion or worse, Harry can tell that his trial in front of the full Wizengamot (the high court) was designed to put him at a disadvantage.
The rest of Harry's summer is boring, as Harry spends most of his time cleaning. Ron and Hermione are made prefects, and Harry does his best to celebrate Ron's accomplishment. Back at Hogwarts, things are very different. Harry is shocked to see that the horseless carriages are now pulled by strange reptilian horses, though a girl named Luna tells Harry that the creatures have always been there. Hagrid is gone, the Sorting Hat gives a warning in its song, and the new Defense Against the Dark Arts professor, Dolores Umbridge, makes a speech at the feast implying that Fudge, the Minister of Magic, is interfering at Hogwarts.
Harry's first day is a disaster. Umbridge tells her class that there's no need to perform defensive magic—only to read the “theory” about it—and she gives Harry a week of detention when he insists that Voldemort is back. In this detention, Harry spends every night that week writing "I must not tell lies" with a quill that cuts into his hand and writes with his blood. On Friday night, when Umbridge takes Harry's hand to inspect his wound, Harry's scar burns and he feels a strange sensation in his stomach. The next morning, Harry writes to Sirius and has a conversation with Cho Chang in the school’s Owlery.
Ron makes the Gryffindor Quidditch team as their new Keeper. He's a poor player and to make things even worse for him, he receives a letter from Percy telling him to stop spending time with Harry. Percy disowned his family over the summer and wants Ron to pledge his loyalty to the Ministry. One night, an image of Sirius's head appears in the common room fireplace. He tells the trio—Harry, Hermione, and the Ron—that Fudge is afraid that Dumbledore will create an army of students to take over the Ministry, hence Umbridge's refusal to teach practical magic.
Harry's second week is almost as bad as his first: Umbridge becomes the Hogwarts High Inquisitor, which gives her hiring and firing power, and he spends another week in detention with her. At the end of the week, Hermione suggests that Harry teach the other students Defense Against the Dark Arts, but Harry gets angry with her. Two weeks later, Harry agrees to talk to interested students in Hogsmeade. Twenty-five people show up. On Monday—seemingly in response to this—Umbridge creates a rule that disbands all clubs and groups. The Defense group decides to meet anyway. It takes McGonagall's help for the Gryffindor Quidditch team to get permission to re-form, after also having been disbanded by Umbridge. That weekend, Sirius speaks to the trio through the fireplace again to voice his support for their secret group. He cuts their conversation short when they see Umbridge's hand grabbing about in the fireplace.
The Gryffindor Quidditch team continues to play dismally. One night after practice, Harry's scar burns again and he feels inexplicably angry. He tells Ron that Voldemort is angry, but he's not sure how he knows. That night, Dobby greets Harry in the common room and suggests that Harry's group could practice in the Room of Requirement, which changes to become whatever a person needs. Harry begins later that week teaching basic spells to his classmates. They decide to call themselves Dumbledore's Army, or the D.A.
The next weekend is the first Quidditch match. Gryffindor wins, but Harry and George beat up Malfoy when he insults their parents—and as punishment, Umbridge bans Harry, George, and Fred from playing again. Harry, Ron, and Hermione realize later that night that Hagrid is home and visit him. He's bruised and bleeding, but tells them about trying and failing to meet with the giants. Umbridge interrupts and is very curious as to where Hagrid was, but he won't say. Hagrid's first Care of Magical Creatures lesson concerns “thestrals,” which Harry learns are the reptilian horses that pull the carriages. Only people who have seen death can see them. Umbridge inspects Hagrid's lesson and acts as though Hagrid doesn't speak intelligible English.
Harry continues to teach at D.A. meetings until right before Christmas. At the last meeting, Cho kisses Harry, though she cries about Cedric Diggory too. That night, Harry dreams that he's a snake and he attacks Mr. Weasley. Harry wakes up screaming and in pain. McGonagall takes him and Ron to Dumbledore's office, where Dumbledore takes Harry seriously but still refuses to look at him. Harry catches his eye at one point and feels an urge to attack him. Dumbledore then sends Harry and all the Weasleys to Grimmauld Place.
Sirius, Harry, and the Weasleys sit up until Mrs. Weasley arrives with news that Mr. Weasley—who was indeed attacked by a giant snake—will live. Harry tells Sirius privately about feeling like he was the snake, but Sirius sends Harry to bed. Harry only pretends to nap and then joins the others to visit Mr. Weasley. When the adults are in the room alone, Fred and George pull out Extendable Ears to eavesdrop. Harry hears that Voldemort might be possessing him, and he feels dirty and contaminated until Ginny points out that she's been possessed, and Harry's experiences don't match hers. At the end of the holidays, Snape visits and tells Harry that he's to teach Harry Occlumency (the art of closing one’s mind to the invasion of another) on Dumbledore's orders.
During Harry's first Occlumency lesson, he discovers that Dumbledore wants Harry's recurring dreams of a corridor to stop, as well as stopping Harry's flashes of Voldemort's emotions. The lesson is awful, as Snape tries to break into Harry's mind. Harry learns that the corridor he keeps dreaming about is in the Department of Mysteries at the Ministry of Magic.
On Valentine's Day, Hermione receives a letter and asks Harry to meet her in Hogsmeade. Harry is supposed to be with Cho, but he agrees. His date goes poorly, especially when he mentions that he needs to meet Hermione. When he meets Hermione, he finds her with Luna and Rita Skeeter. Hermione asks Rita to interview Harry and write an article telling his truth, which Luna's father, the editor of the magazine The Quibbler, has agreed to publish. When the magazine comes out a few weeks later, Umbridge is furious and bans the magazine. Harry dreams that night that he's Voldemort, talking to someone about removing the "weapon" from the Department of Mysteries.
Umbridge fires Trelawney, but Dumbledore replaces her with Firenze, a centaur. At the next D.A. meeting, Dobby alerts the group that Umbridge has found them out. Umbridge drags Harry to Dumbledore's office and Dumbledore insists that the group was his idea. He escapes Fudge and several Aurors—disappearing dramatically—and Umbridge then becomes the headmistress in his place.
After this, Fred and George begin creating mayhem in the school. One evening, Malfoy calls Snape away from Harry's Occlumency lesson. Harry decides to dive into Snape's memories that he stored in a Pensieve and finds a memory of James Potter taunting young Snape. Adult Snape catches Harry doing this, and ends their lessons in a fit of rage. A week later, Fred and George install a portable swamp to distract Umbridge so Harry can use her office fireplace to speak to Sirius and Lupin about what he saw. They assure Harry that James matured and bettered himself, changing from the teenaged jerk that Harry saw in the Pensieve. Fred and George leave school dramatically when Umbridge catches them.
During the season’s last Quidditch match, Hagrid pulls Hermione and Harry away and leads them into the forest. There he introduces them to Grawp, his giant half-brother. Harry also learns that the centaurs are angry that Firenze is working for Dumbledore, so the forest isn't safe anymore.
The fifth-year students begin to take their O.W.L.s the next week. While taking their practical Astronomy exam, the students watch Umbridge and a few Aurors attempt to arrest Hagrid. The Aurors hurt McGonagall, while Hagrid runs away. Harry falls asleep the next afternoon in his History of Magic exam and dreams that Voldemort has Sirius in the Department of Mysteries. He insists that they need to go rescue Sirius immediately. Hermione, Ron, Luna, and Ginny help create a diversion so that Harry can check to see if Sirius is home, but Kreacher tells Harry that Sirius is in the Department of Mysteries. Umbridge catches Harry using her office fireplace, but Hermione tricks her into following them into the woods to see a nonexistent "weapon." The angry centaurs carry Umbridge off and try to hurt Harry and Hermione, but Grawp scatters the centaurs. Luna, Ginny, and Neville meet Harry and Hermione in the woods and Luna suggests that they ride thestrals to the Ministry of Magic.
The Department of Mysteries is more confusing in person than it is in Harry's dream, but he finally leads his friends to where he saw Sirius. Sirius isn't there, but Harry finds a small glass globe with his name on it. When he picks it up, Lucius Malfoy and other Death Eaters appear and ask for the prophecy. In the following fight, Harry and his friends manage to evade the Death Eaters. The Order of the Phoenix, including Sirius, arrives to save the day, but Neville drops the prophecy and breaks it. Just as Dumbledore arrives, Bellatrix Lestrange curses Sirius and he falls through a mysterious archway and dies. Harry chases Bellatrix to the atrium and hides behind the Fountain of Magical Brethren. Voldemort arrives and he and Dumbledore duel. Voldemort attempts to possess Harry, but Harry survives. Fudge arrives and finally sees Voldemort in the flesh, just before Voldemort and the Death Eaters escape.
Dumbledore sends Harry back to Hogwarts and when he returns himself, forces Harry to listen to him. He insists that Sirius’s death is his fault because he kept information from Harry; as a result of Harry’s ignorance, Voldemort tricked him by planting the dream of torturing Sirius. This is why Dumbledore wanted Harry to learn Occlumency—to keep Voldemort from using their strange mental connection to his advantage. Dumbledore also tells Harry something that he insists he should've told him long ago: Voldemort tried to kill Harry as a baby because of a prophecy, and the prophecy also stated that either Voldemort or Harry will have to kill the other. “Neither can live while the other survives,” the prophecy declares.
Harry spends the last week of term grieving and thinking over the implications of all that he has learned. When he arrives in King's Cross, several members of the Order of the Phoenix tell his Uncle Vernon that if he continues to mistreat Harry, there will be consequences.