The estate of Sherlock Holmes author Arthur Conan Doyle has sued Miramax, Roadside Attractions and director Bill Condon, claiming that the upcoming movie starring Ian McKellen in the story of the later life of the famous sleuth, “Mr. Holmes,” infringes on stories that still remain under copyright.

The lawsuit also names writer Mitch Cullin and Penguin Random House, publisher of Cullin’s “A Slight Trick of the Mind” — a new Holmes tale on which the movie “Mr. Holmes” is based.

The movie, set to open on July 17, depicts an aged, retired Holmes looking back on his life and getting involved in an unsolved case.

“Reviews of its early screenings, together with trailers released in the United States, reveal that the motion picture uses the same elements from Conan Doyle’s copyrighted stories,” the estate’s lawsuit says.

The estate notes in its lawsuit that although many of Conan Doyle’s Sherlock Holmes works are in the public domain, 10 works published between 1923 and 1927 remain under copyright. Those works develop details of Holmes’ retirement and later life, the estate claims.

Among other things, the lawsuit claims that Cullin “copied entire passages from Conan Doyle’s copyrighted story ‘The Adventure of the Blanched Soldier.’ Cullin took from that story the creative point of view of Holmes rather than Watson narrating a detective story — and the plot behind it: that Watson has remarried and moved out of Baker Street.”

The Conan Doyle estate lost a federal lawsuit brought by author Leslie Klinger, who challenged its demand for a licensing fee for an anthology of Holmes stories by modern-day authors. The Supreme Court declined to take the estate’s appeal last year, letting stand lower court rulings that determined that all but the 10 works from Conan Doyle’s later years were in the public domain. It also meant that authors were free to write stories featuring the Holmes character as long as they didn’t lift from the 10 works still under copyright.

The lawsuit claims copyright and trademark infringement, and damages, including profits from Cullin’s book and Miramax’s movie.

A spokeswoman for Miramax did not immediately return a request for comment.

The estate said that it licenses Holmes for the BBC series “Sherlock,” CBS’ “Elementar,” and Warner Bros.’ Sherlock Holmes movies.