Dan was having his birthday party at the pub when he was picked up by Martha, who claimed to have a friend who could help him with his dreams. She was actually possessed by Dobtcheff, an alien who had landed on Earth centuries before and was looking for help in retrieving his ship from underground.
When Martha was about to kill Dan, the Second Doctor arrived on the scene. He distracted Dobtcheff and Martha from Dan, and removed Dan from the scene. Dan learned that Dobtcheff had taken over a human baby, and Dan himself was one of the baby's descendants. Dobtcheff had gathered several male descendants of the baby to help him retrieve his ship. Dan tried to resist Dobtcheff's possession of him, and was more successful than the other men, but eventually succumbed.
When Dobtcheff couldn't retrieve his ship, he decided in revenge to destroy it, using a link with Dan to set the auto-destruct. However, the Doctor was also linked to Dan, and helped him reverse the auto-destruct. (PROSE: Reunion)