Romana's allies have moved their base of operations to the ruins of the Academy. Romana herself claims to have recovered from her experiences in the Anomaly Vault, but Leela, even though she's recently been blinded, can still tell when Romana is suffering. Leela has forgiven Romana for her part in Andred's death, as she knows that it is Pandora who is truly to blame, but so far Romana has refused to go on the offensive without a viable strategy. She now believes that she has one, thanks to K9, who recently revealed that he's working against Pandora from within. When Braxiatel confined Pandora's past and present aspects, this left only the Imperiatrix's future self in existence -- yet, according to K9, the Matrix is unable to predict a future for her. He has also informed Romana that Pandora has been avoiding the Matrix, apparently fearing that incorporating in the body of Romana's past incarnation won't be enough to protect her from the pull of the dark partition from which she escaped. To Romana, this means that her current incarnation is stronger than her past, and if she can seize control of the APC Net, she'll be able to defeat Pandora. But the fractured voices echoing in Romana's head suggest she isn't as strong as she'd like to believe she is...
Pandora, like Romana, is hearing voices in her head -- the voice of the true First Romana, who is struggling to resist Pandora's control. It's getting more difficult for Pandora to quash her rebellious inner voice, and she's growing frustrated by K9's lack of progress on creating a technological variant of the dogma virus with which to gain full control of the Matrix. However, she does get some good news when Valyes reports that Captain Janartis has located Romana and her supporters in the ruins of the Academy. There, Commander Hallan and his guards have been trying to build a barricade that doesn't obviously look like one from the outside, and Narvin has hacked into the Academy's surveillance net; with K9's help, he also hopes to circumvent the booby-traps in the Matrix and create a partition around the Academy to protect them from attack. Hallan doesn't entirely trust Narvin, who aided Darkel's coup attempt before the civil war, but Narvin insists that he's learned his lesson. Narvin then spots Janartis and his guards approaching, and when Leela learns that a battle is imminent, she insists upon joining Hallan at the barricades. Hallan doubts that she'll be of any use to him while blind, until she suggests using the incomplete barricade as a decoy to draw their foes into an ambush and then attack them from behind. Hallan concedes that this is a sound strategy.
Janartis and his men use pulse cannons to bring down the barricade, but -- again, at Leela's suggestion -- the defenders have armed themselves with solar panels, which not only shield them from the attacks but absorb the energy and redirect it into the Academy's defences. Narvin uses the energy to power up his Matrix partition, and he sends Annos to warn Leela and Hallan that they have ten microspans to get within the perimeter. Janartis captures Leela and lures Hallan into a trap, but Annos arrives and shoots Janartis from behind. Janartis shoots and injures Hallan before losing consciousness, and Darkel then arrives with reinforcements, cutting off their retreat. Leela refuses to abandon Hallan, and fortunately, some rubble falls from the Academy ruins, giving Leela and Annos just enough cover to get Hallan to safety before the partition goes up.
Unable to take the Academy by force, Darkel offers to negotiate directly with Narvin for old times' sake. Narvin tells the others that he entered his own biodata codes into the partition when he set it up, which means that he's currently the only one who can pass through it safely. He has unfinished business with Darkel, and thus agrees to emerge and talk with her on neutral ground if she agrees to dismiss her guards. She does so, and Narvin steps through the partition to hear her out. Darkel admits to him that Pandora is growing weak, which means that Darkel will be in position to seize power once the war is over -- and she'll remember who helped her and who hindered her. She rests her hand on his shoulder, telling him to consider his position carefully, but he brushes it off and steps back through the partition. Alarms immediately start to sound, and Narvin realises that Darkel has planted a bug bomb under his skin. Leela cuts it out and flings it to safety before it explodes, removing all doubt in Narvin's mind that he may have made a mistake in rejecting Darkel's "offer."
Now that Romana is relatively safe from attack, she can consider going on the offensive -- but she can still hear the voices in her head, and she's frightened of the power that Pandora has over her. Nevertheless, she orders Narvin to adapt his partition in order to get her allies to the APC Net chamber. She refuses to reveal the rest of her plan, and Narvin warns her that he won't abandon his principles even in a time of war; they must bring Pandora to justice, not kill her in revenge. Nevertheless, as Matthias pointedly reminds him, he must obey the orders of his President. As Narvin gets to work and Leela plots out a strategy to avoid the guards on the way there, Romana speaks to Annos, who was injured in the attack but has not sought medical attention. This is because their new surgeon-master is Elbon, the mercenary medic from the Outlands; since his medical station was destroyed and Pandora probably wouldn't appreciate the fact that he sold his services to both sides, he's thrown his lot in with Romana. Annos doesn't trust him an inch, and neither does Romana, but she nonetheless advises Annos to go for treatment in order to keep a close eye on their new ally. Meanwhile, Darkel tries to spin her failure to capture the Academy by reminding Pandora that Romana is now trapped in a bolt-hole to which Darkel believes she possesses a key. Though Pandora suspects correctly that Darkel is not to be trusted, she agrees to give the Inquisitor another chance -- and Darkel thus keeps a secret appointment with Lord Matthias...
Matthias returns to the Academy and summons Hallan to the medical station, claiming to have acquired a disc containing Imperiatrix codes that will enable Romana to seize control of the Presidential complex. Hallan is rightly suspicious, but Matthias claims that he is as well, which is why he wants Hallan to check the disc thoroughly before handing it over to Romana. Matthias leaves to deal with other matters, and Hallan uses the medical computer to scan the disc -- and triggers Darkel's booby-trap, unleashing a technological variant of the dogma virus that has been encoded with Pandora's biodata. Since artron energy is partly technological in nature, Hallan finds that he has been infected and is hearing Pandora's voice in his head. He manages to quarantine the lab before the virus breaks out, but Romana, Leela and Narvin respond to the alarms too late to save Hallan. Struggling to resist Pandora's control, Hallan offers to sacrifice himself by sterilising the lab, but Narvin convinces him to place himself in temporal stasis before doing so, in the hope that they'll be able to find a cure for him once the immediate crisis is over.
Romana is furious with Matthias, who insists that he acted in her best interests; he knew that the disc was bound to be booby-trapped, which is why he gave it to Hallan instead of her, but he also knew that it would have to be baited with the correct codes to be convincing. Unfortunately, the disc is now in quarantine and the codes are inaccessible, and Matthias has succeeded only in depriving Romana of a loyal guard commander. Pandora then manages to break through the communications barrier and make telepathic contact with Romana, trying to activate the Imperiatrix Imprimatur that she insists must still be hardwired into Romana's DNA. Thanks to Hallan's quick actions, however, Romana has not been infected with the dogma virus and is stronger than Pandora had expected -- and as she struggles, she realises that Pandora is weaker than she's been letting on, and that the spirit of the First Romana is still trapped within Pandora's new body, struggling to resist her. Matthias manages to break the communications link before Pandora can try transmitting another sample of the dogma virus down the line, but this isn't quite enough to win back all of Romana's trust. Nevertheless, she now knows that she has another unexpected ally -- her own previous self.
Narvin successfully adapts his partition technology so Romana and her allies can move through the Matrix and emerge in the APC Net chamber. Matthias promises to distract Pandora while Romana makes her move, and although Leela is still upset about what Matthias did to Hallan, she does feel that he has Romana's best interests at heart; in a way, he reminds her of Braxiatel. Romana, Leela and Narvin make their way to the APC Net chamber, where Narvin finally learns that Romana intends to use her own biodata extract to bond herself to Pandora, apparently in the belief that she's strong enough to control the link. He protests that this is too dangerous, and although she claims that she'll have the help of her own first incarnation, he fears that she may place a higher priority on rescuing her first incarnation than on defeating Pandora. Nevertheless, he has no alternative plan to suggest, and he reluctantly connects both Romana and Leela to the APC Net systems...
Once again, Darkel has failed Pandora, but K9 claims to have come up with a near-perfect plan to the Academy. Matthias then contacts Darkel, claiming to be tired of the war and offering to help bring matters to an end by shutting down the partition from the inside. Since Darkel has failed more than once, Pandora orders her to accept Matthias' help whether she wants to or not. Darkel and her guards surround the entrance to the Academy, but once Matthias lowers the partition, Darkel orders Janartis to kill everyone he finds, Matthias included. But the guards walk into an ambush, and soon Darkel finds herself surrounded. She reveals that she's planted a bug-bomb in Janartis' skin and threatens to detonate it and kill everyone unless she's allowed to escape, but Annos shoots and stuns Janartis, pointing out that a bug-bomb can only be activated while its carrier is conscious. Darkel still believes that Pandora will win with K9 on her side, until it occurs to her that it was K9 who came up with this "infallible" plan...
Pandora returns to the Presidential suite to find that K9 has locked the doors, apparently fearing a possible attack due to Darkel's failure to return. Although he promptly lets Pandora in, she is becoming suspicious of his accumulating failures, and her suspicions are borne out when Romana arrives and reveals that she and K9 have lured Pandora into a trap. Romana now understands that it's her past self who is the temporal anomaly, which is why Pandora has insisted upon capturing Romana's current incarnation alive; in her current form, she's unstable and vulnerable. Romana reveals that this is not the real Presidential suite, but its counterpart within the Matrix, and when K9 lowers the barriers to the dark partition where Pandora had been trapped for so long, it starts to draw her back inside. As Pandora struggles to resist the dark partition's pull, Romana tries to free her first incarnation, but she fails, as the Imperiatrix Imprimatur is too heavily imprinted within the First Romana's being. Pandora then pulls herself out of the dark partition, revealing that, although Hallan kept the dogma virus from getting out in the Academy, it has already infected the Matrix with Pandora's essence -- which means that she is now stronger than the dark partition.
This, however, is why Romana brought Leela into the Matrix with her; Leela is not a Time Lord, and is not vulnerable to the dogma virus. Leela now makes her presence known, and the First Romana manages to restrain Pandora long enough for Leela to stab her through both hearts, ending the First Romana's life again and depriving Pandora of a corporeal body. But K9 then shoots Romana with a modified staser beam, infecting her with the virus and enabling Pandora to leap over into her body. Too late, Leela realises that Romana intends to sacrifice herself to destroy Pandora for good, and despite her protests, Romana and K9 eject her from the Matrix, telling her that this is the only way to ensure Pandora's defeat. Leela awakens in the APC Net chamber, where Narvin, Matthias and Elbon have been monitoring events within the Matrix -- which is primed to destroy itself once Romana's plan is complete. Leela insists that they rescue Romana, but Matthias has accepted his President's choice and Elbon doesn't particularly care what happens to her. Only Narvin remains loyal enough to try saving the life of the woman who is still, technically, his President.
Pandora has possessed Romana's current incarnation, but just as she thinks herself victorious, she discovers that Romana is already possessed -- by the sentience from the Anomaly Vault. This is why Romana's mind was still fractured, causing her to hear the voices of other potential Romanas in her head. And since it's Pandora who is the real anomaly, the creature abandons Romana's mind and seizes Pandora's instead. Pandora begs for mercy, to no avail; the creature claims her as its own, and K9 separates the bond between Pandora's biodata and Romana's, ending the threat at last. The creature drags the screaming Pandora back into the dark partition, and the Matrix begins to self-destruct to prevent her from ever escaping again. Screams echo through the Matrix as the preserved minds of former Time Lords are destroyed, and Romana can't block out the cries. But when the Matrix finally collapses, she and K9 are surprised to find themselves alive in the Presidential suite. Presumably, once Pandora was destroyed, Romana's existence was no longer anomalous, and the creature thus ejected her and her K9 unit back into real history. Leela arrives to find Romana exhausted but intact; the Matrix has been destroyed forever and Gallifrey is a shadow of its former self, but the immediate threat of Pandora is over. Romana collapses, exhausted, and K9 warns Leela that she may be psychologically injured from the terrible strain of holding onto her identity while fighting off both Pandora and the anomaly creature. Leela vows to help her friend through the difficult times to come so she will be able wear her war wounds with pride.