Peter O'Toole was originally cast as Sherlock Holmes, and Sir Laurence Olivier was cast as Dr. Watson. But the two actors had not worked well together in the past, and were unable to overcome their differences for this movie.
One of the last actors cast was James Mason. Director Bob Clark had to travel to Spain, where Mason was shooting another movie, to meet with him. Mason agreed to play Watson if he could make him a serious character, not the "silly ass" buffoon character which was the rule. Mason re-wrote two scenes, including the famous "pea scene".
Although Sherlock Holmes is a fictional character, and Sir Arthur Conan Doyle never wrote a story about Jack the Ripper, the idea of Holmes working on that case is not entirely without basis in fact. Joseph Bell, who inspired the character of Sherlock Holmes, was consulted by Scotland Yard on the case.
The replica nineteenth century dockland set took two months and fifty men to construct at Shepperton Studio's largest soundstage. The set also included a replica muddy Thames River.