Most people would be delighted to discover their family shared a link with a famous figure from the past.

Nicholas Waloff certainly was, even though the ancestor in question was once barred from Charles Dickens' office for being drunk on gin.

Mr Waloff has managed to piece together the role of his great-great-great aunt in Dickens' life following 40 years of painstaking study.

He first discovered his relative had been married to Dickens' clerk in 1966.

Since then he has spent hours poring over information taken from the National Archives, marriage records and other sources.

He has now written a story about the clerk, which will be shown on TV later this year.

Mr Waloff, 52, of Freshfield Road, Brighton, said: "I found out my great-great grandfather's sister, Hannah Manton, married John Thompson, of Tavistock House, London, in 1852.

"He was an author's clerk and the author turned out to be Charles Dickens.

"I suppose it's the kind of discovery everyone wants to make."

Thompson acted as Dickens' coachman, clerk and dresser from 1850, when he was 14.

The author described him as "an excellent servant and most ingenious fellow" and "a person of Sam Wellerian tendencies and flights".

Sam Weller is a comic character in The Pickwick Papers, the author's first novel.

Hannah Thompson was banned from the author's office after Dickens visited the couple's two-room flat above it.

He went to see his clerk when he had fallen ill but found Mrs Thompson drunk and sprawled over a desk.

Mr Waloff said the publication of Dickens' letters had been vital in his research.

He said: "It is not often in the world of family history that you have that many letters surviving."

Thompson played an important role in the relationship between Dickens and his mistress Ellen Ternom.

The actress was the subject of Claire Tomalins' 1990 book The Invisible Woman.

Mr Waloff said: "Thompson was very discreet so he was a go-between for the pair.

"He met up with all the characters like Thackeray and Hans Christian Andersen because he helped with research and with getting the manuscripts published."

In 1866, Thompson was thought to be responsible for the theft of eight gold sovereigns from the office.

Dickens tried to hush up the whole affair and set up Thompson in his own business. He then disappears from all records.

Mr Waloff said he had enjoyed bringing the story to life.

He said: "It is a vibrant, fascinating story. It makes the fabric of history come alive for the ordinary person and makes you realise everyone in history played a part."

Mr Waloff's story was one of ten winners in a national competition, the Family History Project, organised by the History Channel, the National Archives and the Royal British Legion.

More than 3,000 entrants were given until February to write stories which brought to life the names on their family trees.

Judge Nick Barratt said: "The fruit of their research provides a poignant reminder of the rich and diverse history of our nation.

"They have brought to our attention ordinary, everyday people - the forgotten men and women who never appear in our official histories."