Invented by Professor Marius, the electronic dog with the super-computer brain was the first mechanical companion. Ever faithful to the Doctor, ever alert and on call via the Doctor's dog whistle, K9 could stun enemies, cut through walls and even play chess! The first version, Mk I chose to remain with Leela on Gallifrey (The Invasion of Time).
The Doctor made a new version, Mk II and helped the Doctor and Romana recover the Key to Time, and then went with Romana II when she left to help the Tharils in E-Space (Warriors' Gate). A Mk III K9 was given to Sarah Jane Smith by the Doctor to make up for their abrupt parting in K9 and Company A Girls Best Friend
The Character appeared in 2006's episode School Reunion with David Tennant & Billie Piper and Sarah Jane Smith. K9 Mark IV was given to Sarah Jane at the end of that story.