K9 returned when Ship used the black hole as fuel. Though Sarah Jane, Luke, Rani and Clyde were happy to have K9 back, Mr Smith was not. (TV: The Mad Woman in the Attic) K9 spent a lot of his time in Sarah Jane's attic at 13 Bannerman Road, Ealing, but left to defeat Travast Polong. He attended Sarah Jane's abortive wedding to Peter Dalton, where he helped the Tenth Doctor, Luke, Rani and Clyde defeat the Trickster. (TV: The Wedding of Sarah Jane Smith) After helping defeat the Slitheen family, Clyde brought K9 to Park Vale Comprehensive School to help him with his test. He helped defeat the Rakweed before returning home. (TV: The Gift) K9 went to the University of Oxford with Luke, but restored Mr White's original programming through a mobile phone.(TV: Goodbye, Sarah Jane Smith)
While caught up in a Time war between the past and the future on the planet Aoris, K9 was forced to spend a thousand years hidden on the planet, setting himself up as 'the great Machina' so that he could found a cult that would aid the Doctor and Romana in bringing the war to an end, hiding behind a fake computer with a version of the TARDIS until he could return to the Doctor and Romana once the war ended (AUDIO: The Paradox Planet, Legacy of Death).
When Romana eventually returned to her own universe, she brought K9 Mark II with her (presumably having repaired it) and eventually became Lady President of Gallifrey. K9 Mark II is first seen on Gallifrey in the Virgin New Adventures novel Lungbarrow by Marc Platt, alongside K9 Mark I, which had remained with Leela. Both K9 Mark I and Mark II appear, voiced by Leeson, in the Big Finish Productions audio adventure Zagreus and the Gallifrey audio series. Leela's K9 (Mark I) was destroyed at the conclusion of the second Gallifrey series and only Mark II appears in the third series.
During Romana's Presidency of Gallifrey, Leela became her bodyguard, and the two K9 units were forced to work together, not always amicably. After Matthias had replaced Romana as President, he nominated her to undertake a mission to find a cure for the Free Time virus, to be followed by exile. K9 opted to remain in the employ of Matthias, fighting the infection on Gallifrey. However, Braxiatel and K9 had planned another operation. Realising that the only cure to the virus was to end the regeneration capabilities of the Time Lords, Braxiatel used a Time Scoop to collect the Time Lord bio-data archive (along with K9). Romana was asked to decide whether to administer the cure or let Gallifrey die and rebuild it from scratch with the bio-data archive. (AUDIO: Gallifrey)
K9 Mark III first appeared in "A Girl's Best Friend", the 1981 pilot for a series, K-9 and Company, which never materialized beyond the first episode. In this, the character is presented to the Doctor's former companion Sarah Jane Smith (Elisabeth Sladen); together, the two embark on what a number of adventures. Only the first of these is depicted on-screen; several are shown in comic book and audio play adaptations, and others are alluded to by the television series. Mark III made a brief appearance alongside Sarah Jane in the Doctor Who 20th anniversary ninety-minute special The Five Doctors (1983), before appearing properly and for the final time in the revived series' episode "School Reunion" in 2006. By the time of that story, Mark III has fallen into disrepair and eventually sacrifices himself to stop a plot by the alien Krillitane and defeat their leader, Lucas Finch (Anthony Head). In the episode's conclusion, the Doctor presents Sarah Jane with a new K9 to encourage her to continue investigating alien activity; the Doctor "rebuilt" him after the Mark III's sacrifice, implying that he had the same mind and memories as his predecessor while still being a "brand new model".