Having left K9 Mark III to Sarah Jane (TV: A Girl's Best Friend) following their travels with Adric in his fourth incarnation, (PROSE: Just a Small Problem) the Doctor eventually built K9 Mark IV. The Eighth Doctor mentioned Mark IV when he met Sarah Jane in 1996. He indicated that the effort in constructing Mark III was "nothing" in comparison to Mark IV. (PROSE: Interference - Book Two)
K9's innards were redesigned twice more over the course of the series, firstly in collaboration with a company called Slough Radio Control. It allowed one of its employees, Nigel Brackley, to be seconded to the series semi-permanently to supervise the prop. Brackley, who has since gone on to a career in the movie industry, controlled K9 for many of its studio appearances. Eventually, there came a point where the dog's inherent liabilities were outweighing his assets, and the internal mechanisms were completely rebuilt by designer Charlie Lumm. The wheels were enlarged and given independent drives for power and better manoeuvrability, and the radio controls were switched from AM to FM signals to resist interference. However, by the time the improved model made his debut in State of Decay, the first story recorded for Season 18, the decision had already been made to write the character out of the series in the adventure Warriors' Gate.
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".
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.