A Girl ' s Best Friend ( TV story ) A Girl ' s Best Friend was a single - episode story produced in 1981 as a pilot for a potential " Doctor Who " spin - off called " K9 and Company " . It formally introduced K9 Mark III , the third iteration of K9 robots , first referenced in the short story " Inter - Galactic Cat " . The BBC chose not to commission a new series , but did televise the episode as a holiday season special . It was only the second story of this kind in the " Doctor Who " franchise , preceded by more than a decade by " The Feast of Steven " , a Christmas Day " break " from " The Daleks ' Master Plan " . With a run time of 50 minutes , it was the first single episode in a " Doctor Who " - related TV production to exceed a half - hour in length . This was the only attempt at a spin - off series during the original run of " Doctor Who " to reach production . It would be more than a quarter - century until this was attempted again . Furthermore , its studio filming was unusually completed at Pebble Mill Studios in Birmingham — making it one of only two stories of the " classic " era ( the other being " Horror of Fang Rock " ) to have the bulk of its studio recording completed outside Greater London . It is common for this episode to be referred to only by the series title , " K9 and Company " , including its initial release on home video and in the Target Books novelisation . Synopsis . Sarah Jane Smith is looking forward to a quiet Christmas with her aunt Lavinia in the sleepy village of Moreton Harwood . When she arrives , she finds her aunt missing and a surprise gift from an old friend waiting to be opened . Sarah , K9 and her aunt ' s ward , Brendan Richards , are caught up in the affairs of a mysterious cult who practise the black arts and are preparing for a human sacrifice . Plot . Sarah Jane Smith visits her Aunt Lavinia . When she arrives at her aunt ' s house , though , she finds that her learned relative has left early for a lecture tour in America , Christmas notwithstanding . Sarah is thus left disappointed by the prospect of another holiday without family . However , Lavinia ' s ward , Brendan Richards , breaks her moment of reflection on her aunt ' s sudden disappearance . After picking him up from the railway station , they return to the house and discover a large crate that has been waiting for Sarah for a number of years . When they open it , they discover a mechanical dog named K - 9 . Upon activation , it tells Sarah that it is a gift from the Doctor . Brendan ' s curiosity about K - 9 is matched only by Sarah ' s renewed concern over Lavinia ' s absence . They thus split up and follow their new - found obsessions . Sarah goes into town to question the locals , and Brendan stays behind to test the capabilities of Sarah ' s new " pet " . In town , Sarah discovers that Lavinia has become disliked by some because of her blunt letters to the local newspaper editors about a growing practice of witchcraft in the area . Brendan , meanwhile , is attacked while using K - 9 to analyse soil samples in Lavinia ' s garden . His attackers , George Tracey and his son , Peter , are tied in to the local coven . Unfortunately , both attackers flee before Brendan can get a good look at them . Since Tracey is actually Lavinia ' s gardener , he is naturally called in the next morning to investigate the damage the scuffle with Brendan caused to the garden . After Brendan attempts to brag about the pH balance of the soil , Tracey sharply comments that gardening is more about respect for nature than scientific theory . Otherwise , though , he doesn ' t betray his more sinister intent towards Brendan . Later that night , he sends his son out to kidnap the sleeping Brendan from the house . This time , Brendan ' s attacker is successful , stealing him out from under Sarah , who is elsewhere in the house , reading up on the local practice of witchcraft . Sarah is now increasingly suspicious of Tracey , believing he would have the opportunity to commit the crime , even if she can ' t yet put her finger on the motive . She therefore finds a way to hide K - 9 in Tracey ' s house . K - 9 quietly monitors the household , until he eventually listens in on a conversation that implicates Tracey as a member of a coven . He also discovers that Tracey intends to kill Brendan in an act of ritual murder . When Tracey leaves his cottage , Sarah is able to retrieve K - 9 , who alerts his new mistress to the impending crime . However , she has no way to enlist the aid of the local police or , really anyone else in the town , because she can ' t substantiate her claim of overhearing the conversation without also then having to explain who and what the anachronistic K - 9 actually is . Realising that she and K - 9 are effectively on their own , she tries to figure out how to stop the sacrifice . Her first order of business is determining the when of it . Using Lavinia ' s books on witchcraft , she and K - 9 deduce it must occur at midnight on the winter solstice , now just a few short hours away . The where of it is more elusive , however , causing the duo to drive around the shire looking at all the churches . As the last few minutes before midnight tick away , they finally realise that there ' s an abandoned chapel on Lavinia ' s property . Rushing home , K - 9 and Sarah are briefly upset at missing something that was right under their noses all along . They arrive just in time for K - 9 to use his blaster to stop the coven ' s priest and priestess from plunging a knife into Brendan ' s chest . Now stunned , the group ' s ringleaders are easily apprehended by the police . Finally able to celebrate Christmas , Sarah receives a call from her Aunt Lavinia . She ' s surprised that Sarah was worried about her , since she left instructions for her business partner to send Sarah a cable . As he turned out to be the High Priest of the coven , Sarah merely laughs and tells her aunt that she has a story to tell her about why that message never reached her . Meanwhile , K - 9 tries to connect with the human holiday in his own way , teaching himself to sing " We Wish You a Merry Christmas " .