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, 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".