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".
Consequences that may occur from this is that the dog ends up not being able to work well with the police in a certain situation, which can have extremely serious effects. In this case, the police must state the problem to the personal dog trainer, so that the K9 trainer can teach the dog and the K9 handler how to fix any mistakes that could have been made by the handler.
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".