Arthur Conan Doyle's work Sherlock Holmes: Discovering the Border Burghs and, by deduction, the Brig Bazaar was unearthed in an attic in Selkirk, according to the Daily Telegraph.
Doyle - a regular visitor to the area - contributed the story to a local bazaar in an effort to raise money to save a town bridge.
The 1,300-word story was a part of a collection of work by local artists called The Book o' the Brig.
Walter Elliot - the man who discovered the story in his attic - said: "In Selkirk, there was a wooden bridge that was put up some time before it was flooded in 1902.
"He really must have thought enough of the town to come down and take part and contribute a story to the book. It's a great little story."
Sherlock Holmes: Discovering the Border Burghs and, by deduction, the Brig Bazaar is now on display at the Selkirk Pop Up Community Museum.
Ian McKellen recently shared a preview of his new film Mr Holmes, in which he plays a 93-year-old Sherlock.
