Harry begins the novel at Privet Drive, out of touch with the Wizarding world and worried about what "You-Know-Who" (as most wizards prefer to call Voldemort) is up to. It transpires eventually that his mentor Albus Dumbledore has ordered Harry cut off from news, and is having him watched over for his safety. Unfortunately, this does not prevent Harry and his cousin Dudley from being attacked by a pair of Dementors, whom Harry must drive off by magical means. Shortly thereafter, Harry is rescued by members of the re-convened Order of the Phoenix, the anti-Voldemort resistance group founded by Dumbledore during You-Know-Who's original reign, and brought to the Order's secret headquarters at Number Twelve, Grimmauld Place in London. While Harry is pleased to rejoin the Wizarding world and regain the company of his friends (Ronald Weasley and his family, Hermione Granger, their former teachers Remus Lupin and Alastor "Mad-Eye" Moody, Aurors Nymphadora Tonks and Kingsley Shacklebolt, and Harry's godfather Sirius Black), the minors are kept out of the Order's affairs for the most part. Finally, when the time comes to designate Hogwarts's new Gryffindor prefects, Ron and Hermione are chosen, rather to the contrary of everyone's expectations.
Because Harry performed magic in the sight of Muggles, in clear violation of the International Statute of Secrecy, he receives a letter from the Ministry of Magic that he has been expelled from Hogwarts and must face a disciplinary hearing. While the expulsion is quickly revoked, Harry must attend the hearing. Harry discovers that the Daily Prophet, a major Wizarding newspaper, has been engaging in a smear campaign against Harry and Dumbledore both, because Minister of Magic Cornelius Fudge would rather believe that their claims of You-Know-Who's return are simply bids for attention. Fudge's attitude extends to the hearing itself, which turns out to be a show trial in the style of full criminal jury. Fortunately, Dumbledore, along with Squib and undercover Order member Arabella Figg, are able to provide conclusive evidence that Harry was defending himself against dementors, not merely showing off for his cousin, and Harry is cleared of all charges; however, Dumbledore does this without looking at Harry once—or even acknowledging that Harry is in the room. The end result is that Harry feels underappreciated and ill-used—instead of helping in the Order, he is forced to help with housecleaning at the long-uninhabited Grimmauld Place and study at school—and his temper erupts frequently throughout the rest of the novel.
Harry has heard nothing about Voldemort because the Dark Lord is simply biding his time; nobody believes he is back (thanks to Fudge), so why tip his hand? However, the Order believes he is attempting to get his hands on a weapon of some sort which he did not have access to during his previous reign of terror; the Order are guarding this object in secret.
Hogwarts School for Witchcraft and Wizardry, the closest thing to a home Harry has, is no longer as welcoming as it was once. This year's new Defense Against the Dark Arts teacher is Dolores Jane Umbridge, Senior Undersecretary to the Minister, a hostile official who attempted to get Harry arrested at his hearing. Hermione guesses, correctly, that her appointment is a sign that the Ministry is interfering at Hogwarts. As a teacher, Umbridge forces the students to study magical theory out of textbooks, rather than practical defence methods: according to Sirius, Fudge believes Dumbledore is recruiting students into a private army. A short time later, she is appointed as High Inquisitor, with the power to evaluate and dismiss other teachers, and impose strict rules and regulations on students. She is revealed to be intensely bigoted, harbouring deep loathing for "half-breeds", such as centaurs, werewolves, and Rubeus Hagrid (a half-giant). She dismisses Sybill Trelawney, the Divination teacher, as incompetent, places Hagrid on probation, and bans Harry, Fred and George Weasley from the Gryffindor Quidditch team for life after the three are provoked into attacking Draco Malfoy. Although Dumbledore is unable to prevent Trelawney's dismissal, he invokes his authority to allow her to remain in the castle, and appoints a new Divination teacher - the centaur, Firenze.
However, Harry makes new friends as well. On the Hogwarts Express he meets a girl named Luna Lovegood, a girl who has a reputation for believing far-fetched stories, leading to ostracism from her peers. Ginny Weasley, who was once tongue-tied by her crush on Harry, has apparently gotten over him and is now able to socialize with him normally. Cho Chang, the pretty Ravenclaw Seeker on whom Harry has had a crush for two years, appears to be seeking opportunities to speak with him, much to his delight. Though Seamus Finnegan is initially deterred by the Prophet's slander campaign, other students (Luna, Ernie Macmillan) declare their belief in him and in Dumbledore. Finally, Harry is pushed into a position of authority when Hermione conceives of the idea to create a secret club whose members will learn and practice actual defensive spellcasting, in direct opposition to Umbridge's castrated approach, which will be useless against Voldemort (not to mention during the year's O.W.L. exams). This "Defense Association," eventually re-branded "Dumbledore's Army" by Ginny in an ironic reference to the Ministry's fears, chooses Harry as their leader, and Harry begins to grow into the position as the year progresses. Dobby the house elf helps Harry find a suitable hideout for the D.A.'s practices: the Room of Requirement.
Hagrid was absent for half the year, he reveals to Harry, Ron, and Hermione, because of a diplomatic mission to the giants on Dumbledore’s orders, to try to dissuade them from joining Voldemort. His mission was a failure, but he also reveals, somewhat shamefacedly, that he secretly brought one of the giants back - his half-brother Grawp, whom he has been keeping tied up in the Forbidden Forest and trying to "civilize."
At the final D.A. meeting before the Christmas holidays, Harry kisses Cho under the mistletoe, and on Valentine's Day goes out on a date with her to Hogsmeade. However, this date is an unqualified disaster: Harry has no idea what to do on one; Cho is revealed to be seeking closure on her relationship with Cedric Diggory, a fellow Harry would really rather not talk about; and Harry drives the final nail by admitting that Hermione asked him to meet her over lunch, implying (incorrectly) that he is interested in her. Cho makes a dramatic exit while Harry wonders what on earth just happened. The demise of their relationship is cemented by Marietta Edgecombe's betrayal (see below).
Throughout the year, Harry has been having dreams of a long corridor with a door at the end; the night of his kiss with Cho, Harry instead dreams that he is a snake attacking Arthur Weasley. Mr. Weasley is gravely injured, and only quick action on the part of the Order saves his life. Harry and Hermione join the Weasleys at Grimmauld Place for Christmas and visit Arthur at St Mungo's Hospital for Magical Maladies and Injuries, where they run across Neville Longbottom and his grandmother visiting his parents, who were tortured into insanity by Bellatrix Lestrange. But Harry's vision has deeper implications: Dumbledore realizes that there is a mental connection between Harry and Voldemort, and (furthermore) that the connection might be two-way. As such, he has Professor Snape begin to instruct Harry in the art of Occlumency, a magical discipline that allows the wielder to shield their thoughts from penetration. The lessons are largely unsuccessful, and end not because Harry has mastered the art but because he peeks into Snape's Pensieve and views Snape's worst memory: the day he was humiliated by James Potter and Lily Evans. The episode leaves Harry shaken, as he realizes that his father was once as cruel to Snape as Snape is to Harry.
Midway through the year, the school is alarmed to hear news of a mass prison break from Azkaban Prison, in which ten of Voldemort’s most powerful Death Eaters escape. Many wizards are not satisfied with the Ministry’s official explanation, and begin to come around to Dumbledore and Harry’s claims, while the D.A. members are inspired to work even harder. Furthermore, on Valentine's Day Hermione arranges to meet Harry for lunch (inadvertently causing his breakup with Cho), but not alone: she has blackmailed yellow journalist Rita Skeeter into writing an interview with Harry about his witnessing Voldemort's return. Luna Lovegood's father (Xenophilius Lovegood) publishes the story in his magazine, The Quibbler. Furious, Umbridge bans the Quibbler from the school—which only fans the flames of the magazine's popularity, as well as support for Harry.
At the beginning of the year, Ron tries out for, and is accepted in, the position of Keeper on the Gryffindor Quidditch team, replacing the graduated Oliver Wood. Though Ron is a talented Keeper, he is also affected by nerves; if he makes a mistake, he becomes so ruffled that he immediately makes more. Having said that, once he decides he can handle a situation, he starts improving with every moment as well, as evidenced by the final match of the year during which his brilliant play secures Gryffindor's victory over Ravenclaw. Ginny, replacing Harry as Seeker after his ban, also triumphs over Cho, which author J. K. Rowling cites as one of the subtle comparisons between Harry's two love interests that show Ginny in a more positive light.
The D.A. is dissolved when Marietta Edgecombe, out of fear for her family's security, confesses to the entire operation. However, to keep Harry safe at school, Dumbledore takes the blame for "his" "army" and submits his guilt—though he is able to overpower Fudge and his retinue and escape. Umbridge becomes Headmistress, enacting even stricter rules and firing Hagrid. The disenchanted Weasley twins revolt, unleashing relentless magical chaos throughout the school, while the staff purposely do nothing to help Umbridge regain control. The twins are caught, but summoning their confiscated brooms, they fly away, leaving Hogwarts to open their own joke shop with the financial backing Harry provided at the end of the previous year.
In the middle of his last O.W.L. exam, Harry has a vision of Sirius being tortured at the Department of Mysteries, although Hermione suspects it may be a trap. (Unbeknowest to them, she is absolutely right: Voldemort has realized the nature of his mental connection with Harry and is broadcasting false images. It was this sort of thing which Harry was to use Occlumency to prevent.) Harry cannot seek help from members of the Order, as McGonagall, Hagrid and Dumbledore have been (separately) run off the premises by Ministry forces; so, with help from various members of Dumbledore's Army, attempts to contact Sirius at Grimmauld Place via the Floo Network in Umbridge's office fireplace. He is caught. Believing that he is attempting to contact the fugitive Dumbledore, Umbridge interrogates Harry, who swears he does not know where he is. Umbridge summons Snape—the actual last member of the Order at Hogwarts, whom Harry had forgotten about—to bring Veritaserum, but Snape says he has run out, and Harry takes the opportunity to pass his vision along in cryptic speech ("They've got Padfoot in the place that it's hidden").
Reaching the end of her patience, Umbridge announces that she plans to use the illegal torture curse on Harry. In response, Hermione pretends to lose her nerve, and confesses that Dumbledore has hidden a powerful weapon in the Forbidden Forest. She leads Harry and Umbridge into the forest where they encounter the local centaur herd. Umbridge, bigoted to the last, insults them and is carried off by them; Harry and Hermione are saved from a similar fate when Grawp enters the scene. Running back to the castle, they encounter Ron, Ginny, Neville and Luna, who insist on accompanying them to the Ministry. The students fly to London on the school's Thestrals.
Reaching the room in his dreams, The Hall of Prophecy, Harry sees that Sirius is not there, but notices a glass ball, labeled with his name, containing some kind of record. As soon as he takes it down from the shelf, a squad of Death Eaters surrounds them, led by Lucius Malfoy: Harry and Voldemort, the two people the prophecy concerns, are the only people who can remove it. The prophecy is "the weapon" Voldemort has been after the entire year. Malfoy demands the prophecy, but Harry and his friends defend themselves, putting up a far tougher fight than the Death Eaters expected, They are are outnumbered and overmatched, but members of the Order, led by Sirius, arrive after being mobilized by Snape, followed by Dumbledore himself. Most of the Death Eaters are apprehended, but Bellatrix gets away—shortly after slaying Sirius.
Harry pursues Bellatrix her into the Ministry’s atrium. Bellatrix is far more powerful, but is taken aback with horror when Harry tells her (truthfully) that the prophecy has been destroyed in the fight and their mission has failed. Voldemort appears in person and attacks Harry, but is confronted by Dumbledore. The two duel inconclusively; to break the stalemate, Voldemort possesses Harry, inviting Dumbledore to kill them both. However, in the midst of his torture, Harry re-visits his grief for Sirius, and Voldemort is unexpectedly repelled by the emotion. Fudge and the Aurors arrive in time to see the Dark Lord before he Disapparates, taking Bellatrix with him. Fudge finally admits that Voldemort has returned. Rita Skeeter's Quibbler story is reprinted in the Daily Prophet, exonerating Harry and Dumbledore.
Speaking alone to Harry in his office, Dumbledore reveals that he has kept many things hidden from Harry over the past five years, such as why he placed the baby Harry with the Dursleys. When his mother died to protect him, this created a powerful protective charm: as long as Harry stays at the house of his mother’s blood-relative long enough to call it home, it shields him in a way even Voldemort cannot overcome. As such, he insists that Harry returns to their home every summer, despite their being abusive guardians. Dumbledore also reveals the contents of the prophecy. It was originally made to him by Sybil Trelawney, while he was interviewing her for her teaching position, and unexpected by either of them:
The one with the power to vanquish the Dark Lord approaches ... born to those who have thrice defied him, born as the seventh month dies ... and the Dark Lord will mark him as equal, but he will have power the Dark Lord knows not ... and either must die at the hand of the other for neither can live while the other survives ... the one with the power to vanquish the Dark Lord will be born as the seventh month dies ...
One of Voldemort's Death Eaters overheard this prophecy, and reported it to him, not knowing that he had only caught the first half. Although there were actually two newborn boys whose parents fit the description in the prophecy (the other being Neville Longbottom), Dumbledore believes that Voldemort chose to attack Harry because he was a half-blood like himself, while Neville is a pureblood. In doing so, Voldemort inadvertently "marked him as his equal."
Dumbledore is reinstated at Hogwarts, and immediately rescinds all of Umbridge’s decrees. Umbridge herself is rescued from the forest by Dumbledore, and appears to still be in shock. Professor Trelawney is also reinstated, though Firenze stays on as well, since he has been expelled from the centaur herd. Harry finds Luna hanging notes in the hall asking for the return of her missing possessions, since students have been taking and hiding them as a practical joke. He remembers that Luna, like him, can see Thestrals, which are invisible except to people who have witnessed death. He asks, and she replies that she saw her mother die, the result of an experimental spell gone wrong. However, Luna appears serene, and says she knows she will see her mother again; she and others who have died are just behind the veiled arch. Harry feels comforted knowing that he may see Sirius again and heads off to finish packing.
At King's Cross station, several Order members are there to greet Harry and the Dursleys. Alastor Moody warns Uncle Vernon that if Harry is maltreated, they will intervene. Harry leaves to head back to 4 Privet Drive with the Dursleys, stopping once to look back towards his two best friends, Ron and Hermione.