Ian McKellen joins the ranks of actors who have assumed the role of Arthur Conan Doyle’s famous sleuth, and he’s joined by director Bill Condon, with whom he collaborated on the masterful “Gods and Monsters” back in 1998. Just as that film depicted an aged James Whale, this one—nicely adapted by Jeffrey Hatcher from Mitch Cullin’s novel “A Slight Trick of the Mind”—portrays Sherlock Holmes in his dotage in 1947, none-too-happily ensconced in rural Sussex, where he’s under close doctor’s care and tended by new live-in housekeeper, the recently widowed, and impecunious, Mrs. Munro (Laura Linney), who’s brought along her adolescent son Roger (Milo Parker) to the job.

The physically frail Holmes, whose mind can occasionally go foggy, spends much of his time searching for remedies for his forgetfulness, tending to bees he keeps on the farm since royal jelly is one possibly beneficial medication, and even taking a difficult trip to Japan, where a correspondent named Mr. Umezaki (Hiroyuki Sanada) assists him in acquiring a specimen of prickly ash, another possible source of relief, from the site of the Hiroshima blast.

It turns out, however, that Umezaki has an ulterior motive to his hospitality that aligns with Holmes’ obsession to rejuvenate his mental faculties in order finally to resolve the one case he failed to close satisfactorily, a disappointment that led him to retire from his trade. As shown in flashbacks, it involved Ann Kelmot (Hattie Morahan), a beautiful woman thrown into deep depression by two miscarriages. Her husband Thomas (Patrick Kennedy) was concerned that her obsession with the glass harmonica, a musical instrument with supposedly supernatural powers of connection with the departed, had brought Ann under the baleful influence of her teacher Madame Schirmer (Frances de la Tour), and begged Holmes to investigate. But was that the true cause of Ann’s condition, or was something else afoot? And could Holmes have done anything to alter the tragic outcome?

The nonagenarian Holmes sets his failing powers of memory and ratiocination to work on the problem, with the cheeky, admiring Roger becoming his new amanuensis, something which his mother definitely fears. Holmes attempts to write down the story accurately, rather than in the way his old friend Watson would have done—indeed, he airily complains of how the good doctor fictionalized him (and has even harsher words when he watches an actor playing him in a supposed movie based on a tale recounted by Watson—a joke accentuated by the fact that the screen Holmes is Nicholas Rowe, who starred in Barry Levinson’s “Young Sherlock Holmes” back in 1985). The effort allows for flashbacks hearkening back some thirty years, in which McKellen exhibits a relatively spry mien as the more dapper, confident detective trailing Ann in contrast with Holmes’ “current” decrepitude. But the action keeps returning to 1947, and to the growing attachment between Holmes and Roger, which leads to an incident which, as a result of the presence of bees and wasps, a loss might occur paralleling the one that sent Holmes into a tailspin decades earlier.

“Mr. Holmes” is beautifully appointed, with impeccable work from production designer Martin Childs, art directors James Wakefield and Jonathan Houlding, set decorator Charlotte Watts and costume designer Keith Madden, and their efforts set off in the luminous widescreen images of Tobias Schliesser. The editing of Virginia Katz smoothly integrates the changing timeframes, and Carter Burwell’s lush score adds the perfect note of melancholy.

But despite all their fine contributions and Condon’s sensitive, unhurried direction, what stands out most are the performances. As one might expect, McKellen makes a wonderful Holmes, both in the 1917 scenes but especially in the 1947 ones, when his imperiousness is set starkly against his declining physical and mental powers. Parker is natural and unforced as his new young protégé, and Linney brings a considerable measure of subtlety to what might have been a stock role as the lad’s commonsensical mother. The rest of the cast is excellent, with Morahan elegant as one more of the elusive women from the detective’s past and Sanada conveying controlled intensity as his Japanese companion.

Gentle and autumnal, “Mr. Holmes” will undoubtedly strike younger viewers as overly decorous, but it’s a perfect antidote to the loud, vulgar action-movie bastardizations of the character starring Robert Downey, Jr. And if in the final analysis its central mystery—the truth which has kept Holmes discontent for so many years—turns out not to be all that surprising, neither, it should be said, were many of Conan Doyle’s, no matter what the Baker Street Irregulars might claim.