He was created more than a century ago by a Scottish doctor.

He made his home on London’s Baker Street.

And he never made it across the Atlantic, let alone to the Midwest.

But iconic pipe-smoking, deer-stalker wearing sleuth Sherlock Holmes was freed in a Chicago courtroom last week, when a federal judge ruled that the Holmes character is public property, no longer subject to copyright. At least, most of him is.

U.S. District Court Judge Ruben Castillo ruled that authors who want to write their own Holmes stories are free to do so without paying a licensing fee to the estate of Sir Arthur Conan Doyle, who created the brilliant detective in 1887 — as long as they only use parts of his character that appeared before 1923.

That means fan-fiction writers can refer to Holmes, his sidekick Dr. Watson, his arch-rival Professor Moriarty, and his habits of injecting cocaine and snootily declaring the solutions to complex mysteries as “elementary.”

Only more picayune details of Holmes’ world, such as Dr. Watson’s second wife and past as a rugby player, which were created in the last eight years of Conan Doyle’s life, remain off limits until 2023, Castillo ruled.

Chicago-born author and Holmes expert Leslie Klinger — who now lives in Malibu — filed the lawsuit in the Northern District of Illinois because he edited a compilation of new Holmes fiction and because Conan Doyle’s estate is represented in the U.S. by Evanston literary agent Jon Lellenberg.

Klinger’s attorney Scott Gilbert said it’s possible that other writers will now take advantage of the lapsed copyright, given the resurgent interest in Holmes, fuelled by recent Hollywood movies starring Robert Downey Jr., and a new BBC Holmes series.

But the estate plans to appeal, according to William Zieske, who represented it in court.

Perhaps mindful that Conan Doyle once wrote that “it is a great thing to start life with a small number of really good books which are your very own,” Zieske argued that Conan Doyle’s family should retain the copyright.

Since Holmes’ personality continued to “mellow” and develop in 10 stories published after 1922, the entire character should remain protected for another decade, he said.

Castillo — Chicago’s top district court judge, who more commonly deals with real-world crime cases — called that a “novel legal argument,” writing in a 22-page legal opinion that the case was “so one-sided” that he had to rule in Klinger’s favor.

“Where an author has used the same character in a series of works, some of which are in the public domain, the public is free to copy story elements from the public domain works,” he wrote.

Email: kjanssen@suntimes.com