Unlike 25 years earlier where she appeared unconcerned with K9 Mark III being seen, Sarah Jane restricted K9 Mark IV to her Ealing house except in emergencies or when she required his services, lest she have to explain him. Her son Luke covered by explaining to a puzzled Peter Dalton that K9 was a Japanese robot toy with pre-programmed phrases. (TV: The Wedding of Sarah Jane Smith) Nevertheless, she sent K9 to serve Luke when he went away to the University of Oxford. (TV: The Nightmare Man)
Introduced into the plot in The Invasion of Time, K9 Mark II first actually appear on-screen in The Ribos Operation (1978). More mobile than his predecessor, Mark II exhibited the ability to sense and warn others of danger. He travels as a companion alongside the Doctor and Romana. Around the time of Romana's regeneration (the transition from actress Mary Tamm to Lalla Ward), the K9 character was explained as suffering from "laryngitis" to accommodate Leeson's departure from the series at the start of the 1979–80 season; for this time, he was portrayed by David Brierley, until Leeson's return for the 1980–81 season. When the Doctor and Romana travel to the parallel universe of E-Space, K9 is severely damaged, in Warriors' Gate (1981). The damage was such that K9 could only function in E-Space; when Romana decided to stay and forge her own path, the Doctor gave K9 to her. The character makes subsequent appearances in remakes of the unfinished serial Shada, alongside the Eighth Doctor (Paul McGann); the 2003 Shada audio play and webcast depict K9 Mark II as having returned to Gallifrey with Romana, now Lady President of the Time Lords, where the Doctor visits them. It is not clear if either of these audio appearances are considered canonical in relation to the continuity of the TV series.
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.
Later he defeated Ahab, who tried to convince him he had murdered Zanthus Pia. He became part of the K9 Unit, being made the responsibility of Gryffen and under the control of Department inspector June Turner. (TV: The Bounty Hunter) He foiled Inspector Drake's plan to control the population using Cerulium (TV: Sirens of Ceres) and experienced fear. (TV: Fear Itself) He aided in the defeat of echoes of Gryffen's family, (TV: The Fall of the House of Gryffen) Orthrus, a duplicate of him created by Drake to frame him (TV: Jaws of Orthrus) and the Bodach. (TV: Dream-Eaters) He met Nehetka and Geb of the Anubians, a race his previous incarnation liberated. He was so obsessed with regaining his lost memories that he didn't notice Gryffen, Starkey and Jorjie's takeover by the Anubians. He soon found out when the Anubians attacked the Department. With Darius' help, he defeated them. (TV: Curse of Anubis)
K9, retroactively "K9 Mark I" (Leeson), initially appeared in The Invisible Enemy (1977) as the creation of Professor Marius (Frederick Jaeger) in the year 5000. K9 subsequently travelled with the Fourth Doctor (Tom Baker) and Leela (Louise Jameson) as a companion of the Doctor in his adventures in time and space until The Invasion of Time (1978). In this serial, K9 decides to remain on the Doctor's home planet of Gallifrey with Leela. Immediately afterwards, Doctor Who would introduce a second incarnation of K9, played by the same prop; the last scene of The Invasion of Time shows the Doctor unpacking a box labeled "K9 Mk II".