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)
The Eighth Doctor Adventures novel Interference: Book Two by Lawrence Miles indicates that the Doctor built a Mark IV model sometime prior to the events of that book, but what happened to this unit is not stated. In the novel The Gallifrey Chronicles by Lance Parkin, K9 Mark II makes another appearance, having been trapped within the TARDIS since the events of The Ancestor Cell. At the end of The Gallifrey Chronicles the Doctor sends K9 on a secret mission to Espero, presumably to seek out his former companion, the living TARDIS known as Compassion.
K9 helped Sarah Jane to defeat Moreton Harwood's murderous Hecate Cult. (TV: A Girl's Best Friend) Circa 1983, K9 Mark III and Sarah Jane lived in semi-detached house where their gate bore a "beware of dog" sign and Sarah Jane permitted him outside unconcealed. Sensing danger, he advised Sarah Jane to either not go out, or to take him with her. She declined, and K9 thus did not accompany her to Gallifrey. (TV: The Five Doctors) K9 accompanied Sarah to an archaeological dig in Egypt. (COMIC: City of Devils) In the early 1990s, K9 assisted Sarah in investigating a supposedly haunted house. (PROSE: Housewarming)
In early 2007, K9 was reactivated by the Tenth Doctor; Sarah Jane was unable to go to any humans for repairs prior as the parts inside K9 could change history. K9's repairs were short lived. In battling Lucas Finch and his Krillitane invasion at the school the next day, Mark III blew up a vat of Krillitane oil, which was now lethal to the Krillitanes destroying himself and the Krillitanes in the process. (TV: School Reunion)
Within the series' narrative, K9 is a robot dog acquired by Doctor Who's title character in the 1977 serial The Invisible Enemy. The first two incarnations of the character travelled alongside the Fourth Doctor (portrayed by Tom Baker) until 1981. In these stories, K9 proved useful for the powerful laser weapon concealed in his nose, his encyclopaedic knowledge and his vast computer intelligence. By 1981, each of the two models of K9 which travelled alongside the Doctor had been left with one of the Doctor's female companions. The character subsequently transitioned into spin-off territory. Producers hoped K9's popularity with children would launch the series K9 and Company, led by actress Elisabeth Sladen in the role of companion Sarah Jane Smith alongside a new K9. In 2006, K9 reappeared in the revived series of Doctor Who. Although the character's appearances in the 2007 spin-off The Sarah Jane Adventures were hampered by the concurrent development of the K9 spin-off, the character began to appear full-time in both K9 and The Sarah Jane Adventures, depicting adventures of the original K9 Mark I and of Mark IV, respectively.