The civil war is over, but Gallifrey is still suffering from its after-effects. The Matrix has been destroyed, and communications have been shut down until K9 can confirm that the Capitol's computer systems are clear of the technological variant of the dogma virus; this is a slow process, as he must frequently perform self-diagnostics to ensure that he himself has not been re-infected. Chancellor Valyes has claimed that he was working against Pandora from within, and since it's vital for the Time Lords to stick to the letter of the law in these difficult times, that means that, as Chancellor, he has become Acting President while Romana recovers from her recent experiences. Matthias is also helping to maintain order as the Time Lords struggle to recover from the war, but Valyes, shaken by the loss of the Matrix, seems to be finding the burden of Presidency more than he can bear.
Darkel has been taken to the Capitol's medical station after suffering a sudden illness that conveniently kept her out of prison. Her guard, Henzil, allows her to visit Romana, but comes to suspect that this may have been a mistake. Darkel enjoys informing the suffering Romana that Valyes has used his powers to recall the High Council, which Romana had dissolved after declaring herself Imperiatrix -- but before Darkel can reveal more, alarms sound throughout the Capitol. K9 has failed to cleanse the dogma virus out of the planetary network in time, and it has shut down the transduction barriers, leaving Gallifrey vulnerable to attack. Sunari timeships swoop down upon the planet and materialise in the Capitol, disgorging soldiers that storm through the streets, spreading panic, confusion and death. In the ensuing confusion, contact with K9 is lost. Although blinded, Leela manages to lure several Sunari soldiers into a trap and kill them. Matthias is wounded by Sunari, but insists that Leela must get him to the Panopticon before he can seek medical attention. When she protests, he snaps and calls her a savage, and although he immediately retracts this and apologises, she feels that he's shown his true colours; nevertheless, she helps him get to the Panopticon and stands guard while he prepares to take action against the invaders.
Valyes retreats to the Presidential office, where he is joined by Narvin and Captain Janartis. Narvin believes that the Sunari's priority will be to evacuate their students from the Academy; the problem is that the Time Lords aren't actually holding the students hostage and don't intend to, which means that have nothing to bargain with. Janartis disagrees, and makes his way to the medical station. There, Henzil has decided that his priority is to protect Romana over Darkel, although Darkel insists that Romana is an ex-President and of no consequence. When Janartis arrives, he agrees with Darkel's assessment, but points out that the Sunari still believe that Romana is President of the Time Lords, which means there's nothing to stop Janartis from handing her over in exchange for their agreement to withdraw. Henzil refuses to allow this, and holds Janartis back at gunpoint until Narvin arrives and stuns Janartis.
Matthias successfully raises a temporary transduction barrier around the Capitol, preventing Sunari reinforcements, Nekkistani or Phaidon craft from joining the battle. Romana begins to instruct him on how to deal with the situation, but Darkel stops her, revealing that the newly convened High Council have declared a Presidential election. At the same time, Matthias asks Romana whether she's just ordered him to open negotiations with the Phaidon and Nekkistani, and, distracted, Romana agrees that he should do so. Meanwhile, Chancellery guards such as Commander Maxil have mustered their forces and are fighting off the Sunari invaders; soon, the incursion is relatively under control, although there remain scattered pockets of fighting throughout the Capitol. However, there's still no sign of K9.
Since Romana is too weak to move, the High Council convenes in the medical station itself. As Valyes prepares to attend the session, Matthias informs him that the Phaidon, Sunari and Nekkistani delegates have been escorted into the Capitol to begin negotiations; since the Monans have no students on Gallifrey, they have chosen to remain in orbit and not intervene directly. Janartis has been placed under arrest for acting independently of the chain of command, and Matthias suggests that there may be some confusion as to what the correct chain of command is; he thus advises the overworked Valyes to delegate some of his responsibilities as Chancellor in order to ensure that the actions of the CIA and Chancellery guard are effectively co-ordinated. Valyes, weary and unable to deal with the pressure of his position -- but unwilling to delegate such important responsibilities to Narvin -- decides to have the High Council appoint Matthias as a Cardinal and delegate the responsibilities to him. Meanwhile, Darkel orders Romana to attend the Council session, and Leela protests that Romana is still unwell and accuses Darkel of taking advantage of her opponent's weakness. Romana tells Leela that Darkel will never change; like Professor Marius used to say, you can't teach an old dog new tricks. Leela understands, and as the apologetic Henzil moves Romana onto an anti-gravity sled and takes her to the Council session, Leela sets off to track down K9.
The first item on the High Council's agenda passes unanimously, and Matthias is appointed as a Cardinal with certain Chancellery powers. Narvin is appalled when Romana is brought in, as she's clearly too weak to attend, but she is determined to be present for this session, as she is fully aware that Darkel is pulling Valyes' strings. Indeed, Valyes now announces that he intends to resign as Acting President -- but this gives him the right to name his successor. Since Gallifrey is now on the brink of war with species for whom Romana has shown past sympathy, he feels that it is not in Gallifrey's best interests to have her as President; thus, he has chosen to name Darkel as his successor. Narvin protests that Darkel is a war criminal, but Valyes reveals that as both Acting-President and Chancellor, he was able to second and fast-track his own proposal to withdraw all charges against Darkel. Darkel thus becomes the official Acting-President, but Romana then points out that she is still only the Acting-President. Romana is still the official President of Gallifrey -- and even if it's clear that the High Council no longer wishes her to be President, she still retains the right to name her own successor, meaning that this election is illegal. Narvin calls a recess while the members of the Council try to come to terms with the rapidly changing political situation.
The peace negotiations begin badly when Matthias arrives late, explaining that communications have been difficult since the Matrix was destroyed. Blastern, the Nekkistani ambassador, is surprised that Matthias has opened with such an admission of weakness, but Matthias insists that he's here to talk openly. Blastern and the Phaidon ambassador, Égopolis, seem to be willing to listen to him -- but the Sunari ambassador, Tooz, is far more aggressive, and reminds the others that their own citizens are still being held captive by the Gallifreyans. Matthias insists that the students are free to leave as soon as it's safe, and that their departure has only been delayed by the Sunari invasion; however, Tooz reminds everyone present that Sunari students have already died in the bombings that preceded the civil war, and insists that the Sunari "invaders" are here on a rescue mission. He demands to know who is in charge of security on the planet, and Matthias is forced to admit that this is now, technically, him. Tooz immediately judges him responsible for the bombings, even though Matthias didn't actually hold a position of power at that time, and refuses to negotiate further with him. The Sunari soldiers will remain in the Capitol until all the "captive" students are safe -- and Tooz is careful to remind his fellow ambassadors that he's including the Nekkistani and Phaidon students in this rescue mission.
While the Council is in recess, Narvin tends to the weakened Romana, and admits to her that his faith in the office of the Presidency has been shaken to the core by the thought that Darkel could attain that position; after all that she's done, he even half-suspects her of deliberately lowering the transduction barriers and allowing the Sunari invasion just to engineer a political crisis and seize power in the confusion. Romana suggests that Narvin himself could stand as a candidate against her, and he admits that this possibility had occurred to him but that he prefers to work behind the scenes. Henzil then announces that Acting-President Darkel has reconvened the Council, but Romana feels strong enough to attend it on her own and asks Narvin to ensure that Leela and K9 are safe.
The peace negotiations are falling apart, as Tooz is swaying Blastern over to the belief that the Gallifreyans are in the wrong here. The Time Lords have a long history of preaching non-intervention and practising quite the opposite, and Blastern is beginning to suspect that these negotiations are a delaying tactic to give the Time Lords an opportunity to erase the entire Sunari race from history. Matthias protests that his people would never do such a thing, but Blastern doesn't believe him, and decides that the negotiations have run their course and that the Nekkistani people will join the Sunari in their just war. Matthias urges him to reconsider, but his decision is made. Égopolis is still open to peaceful negotiations, but when Tooz and Blastern depart, that leaves her and Matthias with little more to discuss. Matthias blames himself for the failure of diplomacy, and after arranging for Égopolis to be escorted back to her ship, he contacts Narvin and gives him new instructions. They're going to need to extend the transduction barriers beyond their current limits, and since that's beyond Matthias' capabilities, it's imperative that K9 be located and returned safely to the Panopticon.
Leela and Annos have been unable to find K9 anywhere in the safe areas of the Capitol, which means he must still be in an area threatened by Sunari troops. Leela detects and pursues a lone Sunari soldier, and realises too late that he was decoying her while the other Sunari led Annos' guards into an ambush. Leela returns in time to help Annos kill the remaining Sunari, but his men have been killed in the ambush, leaving him and Leela alone -- or so they think until they find K9 buried beneath nearby rubble. Annos orders K9 to use his communicator to contact Henzil, but just as K9 had warned, the communication attracts the attention of nearby Sunari troops; however, Leela, Annos and K9 are able to defend themselves long enough for Henzil and Narvin to arrive with reinforcements and rescue them. Narvin doesn't inquire after Leela's health, but only because he knows she would consider that patronising; in any case, his priority is to get K9 back to the Panopticon.
The High Council reconvenes, and Romana opens by questioning the legality of Darkel's position. There was no High Council at the time that Valyes was appointed as Acting President, and although precedent allows the Chancellor to appoint an Acting President under such circumstances, this means that Valyes effectively appointed himself and thus deprived Romana of her traditional right to name her successor. Lord Delox, weary of the complex political machinations, tries to cut through the red tape by officially invoking a vote of no confidence and legally relieving Romana of her position so that an election may be called -- but this gives Romana a legal loophole. According to the letter of the law that Delox has just cited, she must stand down in her current regeneration -- and she thus declares that she will undergo an induced regeneration, and names her own next incarnation as her Presidential successor.
The Nekkistani fleet now descends upon the Capitol, adding their forces to those of the Sunari, but when Matthias arrives in the Council chambers, he dismisses the attack as irrelevant to the matter in hand. He now reveals that by voting to remove Romana from office, the High Council effectively validated the fact of her Presidency up to that point, which means that her political appointments are valid -- and since she ordered Matthias to open negotiations with the attacking alien species, this makes him the official Presidential representative to non-Gallifreyan dignitaries. The validation of Romana's Presidency effectively invalidates Valyes' term as Acting-President, but since Matthias' appointment as Cardinal was ratified by the High Council, that remains valid, which means that he still holds the responsibilities of an on- and off-world security secretary. In other words, he now legally holds all of the powers of a Vice President, and as such, he has the power to declare an election -- and when he does, he will stand as a candidate for President.
As Romana comes to realise that Matthias has deliberately manipulated himself into this position, Narvin contacts Matthias and reports that K9 is bringing the transduction barriers back up. When the barriers are stabilised, they'll expand beyond the limits of the Capitol to cover the planet -- and Matthias realises that he's forgotten something important. He desperately tries to contact Blastern and warn him of the danger, but is too late; the transduction barriers expand, sweeping out over the entire planet and destroying the Sunari and Nekkistani fleets before they have a chance to retreat. Matthias' diplomatic failure has led directly to the deaths of hundreds of Nekkistani, and there will be reprisals for that; nevertheless, he realises that he must continue along the path that has been chosen for him. He thus uses his powers as Vice-President to declare an election. Romana no longer needs to force a regeneration upon herself, but now she finds herself facing two political opponents: not just Darkel, but Matthias as well...