For several years now, students and visitors have affectionately referred to the Old College at Aberystwyth University as Hogwarts. A dramatic, gothic building originally designed to be a luxurious Victorian hotel, the building’s spires, turrets, flying buttresses and arched windows certainly recall JK Rowling’s famous School for Witchcraft and Wizardry. This Welsh Hogwarts, with its yellow Cefn sandstone towers, dominates Aberystwyth’s seafront, rather than being embedded deep in the Scottish Highlands like its fictional counterpart. The setting is no less extraordinary, though – particularly on days when the waves crash over the sea wall.

But similarities between Aberystwyth’s Old College – Wales’s first university, founded in 1872 – and Rowling’s famous school go well beyond the shared gothic architecture. None other than a real-life Professor Snape taught chemistry there to those first generations of students at Aberystwyth. Henry Lloyd Snape (1861-1933) was appointed Chair of Chemistry – or Potions Master, if you prefer – in 1888. His obituary in the Journal of the Chemical Society describes him as “energetic, keen and devoted”, a man serious about science but also committed to literature, an advocate of the debating society and key player in “College dramatics”. At the thought of Henry Lloyd Snape’s twin devotions to potions and dramatic poses, it’s difficult not to conjure up an image of Alan Rickman marching through the halls of Hogwarts, cape billowing behind him.

Harry Potter lore has it that Rowling’s surly Severus Snape was inspired by her own childhood chemistry teacher, John Nettleship, who taught Rowling at Wyedean School near Chepstow, South Wales and passed away in 2011. Rowling herself suggests the unusual name “Snape” comes from a Suffolk village of the same name. While Aberystwyth’s own Professor Snape may not have been the inspiration for his fictional namesake – Rowling might be wholly unaware of his existence – uncanny echoes and parallels between them stop me, as a researcher of both children’s literature and the history of education, in my tracks. Truth, it seems, sometimes really is stranger than fiction.

Henry Lloyd Snape was dedicated to education and public service, as well as potions. He was awarded an OBE in 1921 for his work with disabled service men following the first World War. He was also involved in running secondary as well as university education in Aberystwyth, and in later years became the director of education for Lancashire County Council.

In the early days of Harry Potter’s time at Hogwarts, Rowling’s Snape appears to be the villain of the piece – although, as the books progress, his role in the school and the story as a whole is revealed to be rather more complicated than that. His commitment to the teaching of potions, however, is never in doubt. “I can teach you how to bottle fame, brew glory, even stopper death – if you aren’t as big a bunch of dunderheads as I usually have to teach,” he memorably tells his new pupils in the first book of Rowling’s series.

Henry Lloyd Snape appears to have been no less fastidious, or darkly charismatic. Former student Thomas Jones, who later became Lloyd George’s deputy cabinet secretary, recalled that “every limb of his body was summoned to assist him in the act of lecturing”. In photographs of the time, he appears a handsome, undeniably dashing figure, with dark moustaches and a distinctive widow’s peak hairstyle.

The strange continuities run deeper. Eccentricity was no doubt a feature of many universities in the nineteenth century, but the particular oddities of Aberystwyth’s Old College are even more striking when we consider parallels with Hogwarts. In The College by the Sea, a book published in 1928 to celebrate the university’s first decades, former staff and students recall characters and events that could come straight from fiction. One undergraduate recounts the capture of a young rook, whose “antics and baths afforded much amusement to the staff”. Hedwig, anyone?

Another student summons the college ghost, which was wont to wake college residents with its “blood-curdling cries”. One professor was moved enough by the sounds to embark on that most Victorian pursuit – psychical research. Happily, the revenant turned out to be no Moaning Myrtle, but a mischievous student with a hunting horn.

Echoes between events recorded in The College by the Sea and Rowling’s popular series are not all so light-hearted, however. Henry Lloyd Snape’s arrival in Aberystwyth came on the heels of tragedy and high drama. The university’s original chemistry professor, and Snape’s predecessor, Professor Humpidge – a name that wouldn’t be out of place in Rowling’s fictional world, either – died at the age of 35, his demise put down to distress caused by the fire that engulfed parts of Old College in 1885. Three people died in the conflagration, which began in Humpidge’s chemistry laboratory. Snape joined the university as Humpidge’s replacement.

HL Snape took up his post at the “Welsh Hogwarts” at an interesting time. Quartered in new laboratories built after the fire, he conducted research on such topics as aromatic cyanates and carbamates, and amarine and amarone. To anyone (like me) who hasn’t studied chemistry since their GCSEs, these words might as well be the names of magical potions. Professor Snape would also have taught some of the young women who joined Aberystwyth university when it became one of the first British institutions to admit female students – early pioneers who paved the way for the Hermione Grangers of the future. In fact, it’s in this context that I first stumbled across him. An 1890 article about Aberystwyth published in The Women’s Penny Paper, which championed women’s access to higher education, noted that those women students who attended Snape’s courses earned the right to sit university exams at Edinburgh University, as well. And there’s another odd connection – Edinburgh is the city in whose cafes Rowling first set pen to paper.

Plans are currently under way to refurbish Old College and make it as central to the lives of current students and the local mid-Wales community as it was in the Victorian period. In a challenging funding climate for both universities and students, there’s something especially inspiring about such conjunctions and continuities.

Many of my own students count Harry Potter’s adventures among their favourite books, and some even credit Rowling with setting them off on their quest to study literature at university. Just as Henry Lloyd Snape inspired some of the first generations of students in Wales, Severus Snape has enthused a new generation of students.

Beth Rodgers is lecturer in nineteenth-century literature in the Department of English and Creative Writing at Aberystwyth University. Her book, Adolescent Girlhood and Literary Culture at the Fin de Siècle – Daughters of Today, will be published next year by Palgrave Macmillan.