Built in the year 5000 as the robot companion of Professor Marius, K-9 was a mobile computer with built-in defensive weapons. After helping defeat The Swarm, the Professor offered K-9 to the Doctor and Leela. Although this version remained on Gallifrey with Leela when she left the TARDIS, the Doctor constructed a second K-9 from spares. This K-9 helped the Doctor and Romana reassemble the Key to Time, was taken hostage by Lady Adrasta and led the attack on the Vampire castle. Damaged by the Time Winds, he remained in E-space with Romana and the Tharils. A third K-9 was gifted to Sarah Jane Smith, helping her defeat the Cult of Hecate and, much later, blowing up the Krillitanes at Defry Vale High School. The Tenth Doctor left Sarah a fourth K-9 model, who lived with her at Bannerman Road, then accompanied Luke to University in Oxford.