The Fourth Doctor and K9 Mark II spent an indeterminate period of time together. However, the Doctor appeared to be activating K9 Mark II, implying that no significant time had elapsed since leaving Gallifrey. (TV: The Ribos Operation) It is possible that the Doctor spent some time at Nest Cottage before activating him. (AUDIO: The Stuff of Nightmares)
Almost as soon as he arrived, K9 Mark IV left Sarah Jane to stabilise a dangerous black hole in space which had been created in Switzerland. He could only speak with Sarah Jane occasionally via a cabinet with a space-time link when the orbit of the black hole intersected with Earth's and did not know when he would complete the job. (TV: Invasion of the Bane) However, he returned to Earth very briefly during emergencies. He did so on two later occasions in order to render vital assistance. The first time, he fought Mr Smith in pitched battle to give Sarah Jane time to upload the Armageddon Virus. (TV: The Lost Boy) The second time, he quickly uploaded TARDIS base codes to Mr Smith, assisting the Tenth Doctor in returning Earth to its correct location in space. (TV: Journey's End)
K9, occasionally written K-9, is the name of several fictional robotic canines (dogs, the name being a pun on the pronunciation of "canine") in the long-running British science fiction television series Doctor Who, first appearing in 1977. K9 has also been a central character in three of the series television spin-offs: the one-off K-9 and Company (1981), The Sarah Jane Adventures (2007–2011) and K-9 (2009–2010). Although not originally intended to be a recurring character in the series, K9 was kept in the show following his first appearance because he was expected to be popular with younger audiences. There have been at least four separate K9 units in the series, with the first two being companions of the Fourth Doctor. Voice actor John Leeson has provided the character's voice in most of his appearances, except during Season 17 of Doctor Who, in which David Brierley temporarily did so. The character was created by Bob Baker and Dave Martin, to whom rights to the character still belong; consequently, Baker's spin-off series K9, which is not BBC-produced, cannot directly reference events or characters from Doctor Who, though it attempts to be a part of that continuity.