The Valley of Fear is the fourth and final Sherlock Holmes novel by Sir Arthur Conan Doyle. It is loosely based on the Molly Maguires and Pinkerton agent James McParland. The story was first published in the Strand Magazine between September 1914 and May 1915. The first book edition was copyrighted in 1914, and it was first published by George H. Doran Company in New York on 27 February 1915, and illustrated by Arthur I. Keller.
The novel starts with Sherlock Holmes receiving a cipher message from Fred Porlock, a pseudonymous agent of Professor Moriarty. After Porlock sends the message, however, he changes his mind for fear of Moriarty's discovering that he is a traitor. He decides not to send the key to the cipher, but he sends Holmes a note telling of this decision.