The book begins with a battle between [=ThunderClan=] and [=RiverClan=] over who owns Sunningrocks, a piece of territory smack in the middle of them. When the odds become impossible, Redtail, the [=ThunderClan=] deputy, convinces Tigerclaw, a [=ThunderClan=] warrior, to retreat. In the [=ThunderClan=] camp, Bluestar, the leader, is distraught because [=ThunderClan=] hasn't lost a battle in their own territory since she became leader. The medicine cat Spottedleaf gets a message from [=StarClan=]. She recounts its contents: "Fire Alone Can Save Our Clan." Bluestar trusts Spottedleaf because she has never been wrong before.

Meanwhile, a kittypet called Rusty is hunting a mouse. It turns out to be a dream and he wakes up and decides to go into the woods. His friend Smudge tries to dissuade him, but he ignores Smudge and starts exploring. While tracking a fox, he is attacked by a forest cat. After a short fight, the forest cat introduces himself as Graypaw. Graypaw tells Rusty about the four Clans. Bluestar and Graypaw's mentor Lionheart appear. Rusty is curious about the clans, and Bluestar tells him that if he is so curious, he can join [=ThunderClan=]. She grants him some time to think. Rusty comes back later and meets Lionheart and Bluestar's nephew Whitestorm. The two warriors take Rusty to the [=ThunderClan=] camp and Bluestar begins to perform the ceremony to make him an apprentice. However, a cat called Longtail notices Rusty's collar and realizes he is a kittypet. Longtail insults Rusty, so they fight, and Rusty's collar is torn off. Bluestar sees it as a sign from [=StarClan=] that Rusty can now join [=ThunderClan=], so she gives him his apprentice name, Firepaw. However, she doesn't select a mentor for him. Suddenly, Ravenpaw, an apprentice, runs into camp and says that Redtail is dead. Ravenpaw collapses, but his mentor Tigerclaw arrives to explain what happened. During another fight with [=RiverClan=], Oakheart, [=RiverClan's=] deputy, killed Redtail, so Tigerclaw killed him in revenge. Bluestar names Lionheart the next deputy - to Tigerclaw's dismay, as he wanted to be deputy.

The next day, Lionheart and Tigerclaw show Firepaw and Graypaw (who complains about already seeing it) around the territory, and tell them about the four Clans: [=ThunderClan=] the brave, [=WindClan=] the swift, [=RiverClan=] the wise, and [=ShadowClan=] the fierce. Firepaw wonders why the Clans don't unite, but Lionheart and Tigerclaw say that a union of the Clans is a treacherous and terrible idea [[note]]much to the amusement of readers who have already finished ''The Darkest Hour''[[/note]]. Two moons later, Firepaw is attacked by a rogue named Yellowfang while on a solo hunting mission. He injures her leg, rendering her unable to walk, and she looks hungry so he hunts for some food for her. Firepaw eats the scraps, breaking the warrior code because he is feeding himself before the Clan. His Clanmates appear and inform him that Yellowfang is the [=ShadowClan=] medicine cat and take her prisoner after learning she has left [=ShadowClan=]. Firepaw is punished for breaking the code by being forced to look after Yellowfang. Bluestar decides at this point that she will mentor Firepaw. Yellowfang continually berates Firepaw for not doing a good job and for being a former kittypet. In response, Firepaw says that she is only doing this to hide her embarrassment at having to be looked after by someone. This impresses Yellowfang. A short time later, Firepaw is allowed to return to his training.

Tigerclaw gives Firepaw, Graypaw, and Ravenpaw a hunting assessment. Firepaw meets Smudge while hunting, and, after talking with him, decides that joining [=ThunderClan=] was the right choice. At the full moon, Firepaw, Graypaw and Ravenpaw are permitted to go the Gathering, a meeting of all four Clans where they share news. [=WindClan=] doesn't show up, and as it turns out, [=ShadowClan=] drove them out. Brokenstar, [=ShadowClan's=] leader, demands hunting rights for [=ShadowClan=] in the territory of the other clans. Bluestar refuses, but Crookedstar, leader of [=RiverClan=], agrees to it. Brokenstar also says that a member of [=ShadowClan=] killed some kits and was driven out. The [=ThunderClan=] cats assume he means Yellowfang, so they rush home to lynch her. Firepaw runs to camp ahead of everyone else to warn Yellowfang. However, when the cats try to attack Yellowfang, Bluestar says that Yellowfang can stay because she hasn't done anything wrong. Also, Brokenstar didn't give a name for the kit-killing cat, and as such it could be some other [=ShadowClan=] cat.

Later, Bluestar decides to travel to the Moonstone to share words with [=StarClan=], the warrior ancestors of the Clans, in order to find out how to defeat Brokenstar. She takes Firepaw, Graypaw, Ravenpaw and Tigerclaw, because all apprentices must journey to the Moonstone before becoming warriors. When they reach the cave with the Moonstone inside, Graypaw and Ravenpaw are left outside as guards. Bluestar, Tigerclaw and Firepaw go to see the Moonstone, but Tigerclaw gets scared and runs away. Bluestar finds out that they must return to camp at once. On the way back they are ambushed by rats. A loner called Barley saves them, but not before Bluestar is killed. Fortunately, Clan leaders have nine lives, so Bluestar comes back to life. She tells Tigerclaw she has four lives left. When they get back to camp, [=ShadowClan=] is attacking. The deputy Blackfoot kills an elder named Rosetail, but Yellowfang defeats him and the [=ShadowClan=] cats run away. Yellowfang is welcomed as a full member of [=ThunderClan=]. Meanwhile, Lionheart dies of injuries, and Tigerclaw is named deputy. Ravenpaw expresses worry over this. Later, Firepaw hears Tigerclaw spreading rumours that Ravenpaw is a traitor, which he knows to be false. When he asks Ravenpaw about this, Ravenpaw tells him that he witnessed Tigerclaw kill Redtail. Later, while he trains with Bluestar, Firepaw learns that Bluestar lied about her lives: she only has two remaining. He also learns about Spottedleaf's prophecy.

Afterwards, Spottedleaf is found dead in her den and both Yellowfang and some kits go missing. The Clan assumes that Yellowfang killed Spottedleaf and kidnapped the kits, but Firepaw has his doubts. Bluestar doesn't send Tigerclaw out to find Yellowfang because she knows that he would kill her on sight. She sends Firepaw ahead of everyone else, and he takes Graypaw and Ravenpaw with him. Firepaw sends Ravenpaw off to live with Barley and says that he will tell [=ThunderClan=] than Ravenpaw died. Firepaw and Graypaw confront Yellowfang, who explains her motive for leaving the camp: she had recognized the scent of a [=ShadowClan=] warrior named Clawface on Spottedleaf headed out to pursue him. She also explains that Brokenstar trains cats to be warriors at an age before the warrior code allows it. In one training exercise, he was too brutal and killed some kits. He laid the blame on her, but she did not defend herself because he is the son of Raggedstar, who she respected. She also explains that if it looked like Brokenstar could be defeated, then a good percentage of [=ShadowClan=] will help drive him out. Yellowfang, Firepaw, Graypaw, and a [=ThunderClan=] patrol team up with some [=ShadowClan=] cats to attack the camp and defeat Brokenstar. Brokenstar defeats Yellowfang and says that he killed Raggedstar so he could be leader. Firepaw attacks and defeats him, resulting in Brokenstar being driven out. The members of [=ShadowClan=] promise to reform it. For their nobility in the battle, Firepaw and Graypaw recieve their warrior names, Fireheart and Graystripe. Fireheart vows to expose Tigerclaw.