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.
Although the first incarnation of K9 does not appear again in televised Doctor Who media, he is the star of the 2009 K9 television series, in which he undergoes a sort of "regeneration" process from which a new, more sophisticated and futuristic K9 emerges; in the first series of K9, the character is transported to London c. 2050 by Professor Gryffen (Robert Moloney). Though on regeneration the character loses his memory of his adventures with the Doctor, he assists Gryffen and several teenage companions against a dystopian regime of "The Department". The upgraded K9 has new specifications, sporting a sophisticated head-up display, the ability to fly, and more powerful laser weapons.
K9 Mark III was a gift from the Doctor to Sarah Jane Smith (TV: A Girl's Best Friend). This K9 was broken for many years, until he was repaired by the Tenth Doctor. This K9 also had a "maximum defence mode", as well as offensive capabilities, such as a nose-mounted laser gun. He sacrificed himself to save Deffry Vale High School from Krillitanes. (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.