Having returned to power, Death Eaters attack both the Muggle and Wizarding worlds, while Lord Voldemort has given Draco Malfoy an assignment. Bellatrix Lestrange goads Severus Snape into making an Unbreakable Vow with Draco's mother, Narcissa, to protect Draco while he works to carry out the assignment if he fails. Scarred by his experience at the Ministry of Magic with Voldemort, Harry is reluctant to return to school. Dumbledore encourages Harry to continue and takes his help in enticing former Potions Professor Horace Slughorn to return to Hogwarts. Later, while leaving Fred and George's new shop in Diagon Alley, Harry, Ron and Hermione notice Draco associating with Bellatrix Lestrange, Fenrir Greyback and Narcissa Malfoy in Borgin and Burkes, leaving Harry suspicious.
On the Hogwarts Express, Harry follows Malfoy suspiciously under the Invisiblity Cloak and overhears him saying he has an important job to do. Malfoy works out Harry is there and paralyses him with the Body-Binding Curse. Malfoy breaks his nose and hides him under the Cloak so that he will be taken back to London while unable to move. He is however saved by Luna Lovegood.
At Hogwarts, Harry and Ron borrow textbooks from the school for Slughorn's Potions class. The previous owner of Harry's copy, the "Half-Blood Prince", has annotated the book with additional instructions and spellcraft that allow Harry to excel in class and win a vial of the luck potion Felix Felicis. After making it as Keeper in the Quidditch team, Ron becomes a Quidditch hero and he forms a relationship with Lavender Brown, which leaves Hermione heartbroken. At the same time, Ginny Weasley is in a relationship with Dean Thomas, which in turn, leaves Harry distraught. He hides his feelings from all but Hermione, however, knowing Ron is very protective of Ginny and would never allow a relationship between them. Harry spends Christmas Break with the Weasleys, during which he discusses the situation at Hogwarts with Order of the Phoenix members Arthur Weasley, Remus Lupin and Nymphadora Tonks. During this time, he becomes closer to Ginny, who has since broken up with Dean Thomas. Bellatrix Lestrange and Fenrir Greyback attack the Burrow and attempt to kidnap Harry. The Order is able to keep everyone safe, but the Death Eaters set fire to the Burrow.
Draco continues to elude Harry while perfecting the use of a Vanishing Cabinet inside the Room of Requirement. Harry suspects Draco is behind two attempts on Dumbledore's life: one through a cursed necklace (which accidentally hospitalizes Katie Bell), and another through a bottle of poisoned mead which nearly kills Ron. In his semi-comatose state, Ron mumbles Hermione's name, causing his relationship with Lavender to end.
During a confrontation with Draco, Harry hits him with a curse from the Half-Blood Prince's book which severely injures him. Snape arrives and heals Draco as Harry retreats. Fearing that the book may be filled with more Dark Magic, Ginny convinces Harry to leave the book in the Room of Requirement to prevent using it ever again. While Harry closes his eyes, Ginny hides the book and before he opens his eyes, she kisses him passionately, starting a relationship between them.
During private meetings held throughout the year, Dumbledore shows Harry memories of a young Tom Riddle and reveals Slughorn retains a memory critical to Voldemort's defeat. Harry manages to retrieve the memory using Felix Felicis. The memory reveals that Voldemort had been seeking information creating seven Horcruxes, devices that safeguard a portion of the creator's soul, thereby granting him immortality until the Horcruxes are destroyed. Dumbledore reveals that two of Voldemort's Horcruxes have already been destroyed: Tom Riddle's diary, and his mother's ring. After locating another Horcrux, Dumbledore requests Harry's help to retrieve it. Deep inside a seaside cave, Harry is forced to make Dumbledore drink a foul, mind-altering potion that hides the Horcrux, a locket. Though gravely weakened by the liquid, Dumbledore is able to defend them from a horde of Inferi and Apparates himself and Harry back to the Astronomy Tower at Hogwarts.
Once there, Dumbledore first tells Harry to fetch Snape for help, but tells him to hide when footsteps approach. Draco appears and reveals that Voldemort has chosen him to kill Dumbledore, but is unable to follow through. Snape arrives, motions to Harry to stay hidden, and joins the throng of Death Eaters that arrive through the Vanishing Cabinet and surround Draco as he hesitates. To Harry's horror, Snape casts the Avada Kedavra curse to kill Dumbledore and then escapes from the castle with the other Death Eaters. In their wake, they cast the Dark Mark, wreck the Great Hall, and set fire to Hagrid's Hut. Harry tries to stop them, but Snape deflects Harry's spells and Bellatrix stuns him. Before departing, Snape reveals to Harry that he is the Half-Blood Prince. Harry returns to the school to find the staff and students mourning Dumbledore, and walks over to the body, eventually breaking down in tears as Ginny comforts him. Everyone raises their wands in respect of their headmaster.
While Hogwarts mourns Dumbledore's death, Harry reveals to Ron and Hermione that the locket Horcrux was a fake. The locket contains a message from an "R.A.B." stating he has already taken the real Horcrux and hopes to destroy it and the rest of the Horcruxes. Rather than return for their final year at Hogwarts, Harry and his friends vow to seek out R.A.B. and the remaining Horcruxes as Dumbledore's phoenix, Fawkes, flies into the horizon.