Creating the portal
In the 17th century, Erasmus Darkening posed as a magician and alchemist to get shelter from and employment by Lord James Marchwood. Over the course of what the legend stated to be two years, Darkening used advanced technology to open a portal between dimensions to get home. Innocent people were caught in Darkening's experiments and trapped between the dimensions; they were afterwards sighted at times and thought to be ghosts haunting Ashen Hill Manor.
After Marchwood's two children, Joseph and Elizabeth, fell victim to Darkening's experiments, an enraged Marchwood attacked Darkening in his laboratory and impaled him with a sword. This act damaged Darkening's accelerator; the device became powered by the people it took and channelled their life energy into Darkening, granting him immortality.
Darkening became obsessed with his immortality, and began to call the Manor his dominion. Marchwood confronted him again, and tricked him into stepping into a electromagnetic field, ending his existence whereupon by stabbing his sword into the metallic floor engraving of the Marchwood family seal, which channelled the energy into it and trapped Darkening inside to be destroyed. His last words were, "Eternity... I've lost eternity!" With Darkening vanquished, Sarah Jane Smith disabled his device once and for all. (TV: The Eternity Trap)
Behind the scenes
The The Sarah Jane Adventures photo novelisation The Haunted House told a completely different story about Erasmus Darkening. In this story Darkening wasn't an "evil" alien who had kidnapped humans. He was an alien who came to Ashen Hill Manor hundreds of years before 2009 and was stuck there. His machine would take him anywhere but it was broken. People thought there was a ghost in the house but it was just Erasmus Darkening who was reading books, watching the fountain or hearing the bells. He had to do something while he was stuck in the house. Sarah Jane finally repaired Erasmus's machine and Erasmus could leave Ashen Hill Manor. His last words were, "Free at last."