Professor Frederick Marius, who invented the first K9 in the year 5000 while working on the asteroid K4067, described him as "my best friend and constant companion." Marius had a dog on Earth, but weight requirements did not allow him to bring his real dog into space, so he built K9. (TV: The Invisible Enemy) He built K9 by using the latest technology. Marius used his own medical computer, a state-of-the-art intraresponsive brain app, protective anti-radiation cladding, probes, a laser scapel, a vision and voice box and two scanning antennas. He put these parts together and created K9. (PROSE: One Man and His Dog) According to one account, the Professor copied the remnants of one of the versions of K9 created by the Doctor and given to Sarah Jane Smith. (PROSE: Tautology)
In 1985, a series of gamebooks featuring the Sixth Doctor were published by Severn House under the title Make your own adventure with Doctor Who in Britain and Find Your Fate — Doctor Who in the United States. These books were actually written by scriptwriters for the television series. Martin wrote Search for the Doctor which takes place in the mid-21st century and features K9 Mark IV being reunited with the Sixth Doctor long after Sarah's death.
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.