Save for a mention in Arthur Conan Doyle’s “His Last Bow,” precious little is known about the latter years of Sherlock Holmes: “We heard of you as living the life of a hermit among your bees and your books in a small farm upon the South Downs,” Dr. Watson tells Holmes in that final installment of the author’s short stories — hardly the sexiest ending to an illustrious career.

Novelist Mitch Cullin caught up with the character at age 93 in “A Slight Trick of the Mind,” which finds Sherlock a bit less sharp than before, handling a case whose clues are tied up in his foggy memories of the past. “Mr. Holmes,” the bigscreen adaptation of Cullin’s novel, debuted Feb. 8 at the Berlin Film Festival, and picks up where earlier stories left off. The indie movie, which Miramax will release later this year in partnership with Roadside Attractions, reunites screen legend Ian McKellen with Bill Condon, the man who directed him in the 1998 film “Gods and Monsters.” Since that initial collaboration 17 years ago, Condon has kept in constant touch with McKellen. “In the time since we first worked together, Ian has become an international movie star. Obviously with ‘X-Men’ and ‘Lord of the Rings,’ things changed drastically. It’s wonderful that he comes back to this, more as an icon playing icon,” says the filmmaker.

David Vintiner for Variety

As it happens, Sherlock Holmes’ popularity also seems to be at an all-time high. On the smallscreen, the BBC has earned a new generation of fans with its top-rated “Sherlock” series, which launched the career of Benedict Cumberbatch (who played controversial Wiki-Leaks founder Julian Assange in Condon’s “The Fifth Estate”), while Robert Downey Jr.’s rowdier bigscreen franchise racked up more than $1 billion worldwide from two movies.

According to McKellen, 130 actors have played Sherlock Holmes. “That doesn’t bother me, because a lot more actors have played MacBeth and Coriolanus and Richard III and Hamlet and King Lear,” he says. “It’s possible in this country to play all those parts, because they’re plays that people want to go on seeing in new versions. That’s why there’s a new ‘Hamlet’ every year, if not two or three. The year I did ‘Hamlet,’ there had been 10 ‘Hamlets’ in London. Ten! — including Richard Chamberlain and Alan Bates.”

Holmes was first embodied onstage by British actor William Gillette, who developed the character in collaboration with Doyle. Gillette also starred in a 1916 silent film version thought lost until just last year, when a nitrate duplicate was found at the Cinematheque Francaise in Paris. A restored version will screen at the San Francisco Silent Film Festival in May.

Though he is familiar with Gillette’s portrayal, McKellen is quick to point out that his own is an entirely different take on the character. “The fun of it is that everyone thinks they’ve known who Sherlock Holmes is,” he says. “I’m nothing like the Sherlock Holmes that my friend John Watson made in the books that he wrote about me. I never smoke a pipe, I much prefer cigars, and I never wore a deerstalker. Whereas as Gandalf, we slavishly followed the images, not that Tolkien had written, but that the famous illustrators of the novels, Alan Lee and John Howe, had put down.”

David Vintiner for Variety

Of course, “Mr. Holmes” still clings to certain defining characteristics: The detective relies on his magnifying glass, and remains as self-absorbed as ever. But both Condon and McKellen were more interested in exploring the psychology of a legend in the twilight of his career.

“It is in its essence a real study of mortality and the last stage of a great man’s life,” Condon explains. “And it was interesting, because we had done that almost 20 years ago (in “God and Monsters”), and now I am the age Ian was when he played James Whale, and Ian is in his 70s” — though ‘Mr. Holmes’ allows the actor to play both younger and older: 93 in the present, not long after the bombing of Hiroshima, and almost three decades younger in 1919-set flashbacks. “At the end of it, my joke to Ian was that as the third part of the trilogy, all we can think of is him playing Methuselah.”

McKellen was already a venerated stage actor when he took the part of “Frankenstein” director Whale in “Gods and Monsters,” and though his suave turn in the 1995 Shakespeare refresher “Richard III” helped build that distinction, it was his performance for Condon that cinched his reputation in the film world. The picture earned both men their first Oscar nominations — and in Condon’s case, a win for adapted screenplay.

Condon recalls that on “Gods and Monsters,” he and McKellen “had such a good, intimate time, it just felt as though we wanted it to spill over into real life. It became real — you know that thing, where suddenly you become friends, and you check in on each other.”

David Vintiner for Variety

Whenever McKellen flew to New Zealand to work on what the actor calls his “Middle-earth films,” he would make a point to stop off in Los Angeles and stay with Condon. And whenever life took Condon to London — where he is presently overseeing pre-production on the live-action version of Disney’s “Beauty and the Beast” musical — the director would drop by McKellen’s house on the Thames.

Like McKellen, Condon’s career has taken off since the two first met. As a screenwriter, he received a second Oscar nomination for “Chicago,” and he went on to direct “Dreamgirls” and the final two installments in “The Twilight Saga.” His latest release, 2013’s “The Fifth Estate,” was a colossal flop, with less than $9 million in global ticket sales.

McKellen views “Mr. Holmes” as a welcome return to a smaller, more intimate sort of project: another three-hander, like “Gods and Monsters,” between an aging curmudgeon, his housekeeper (Laura Linney, another star who’s stayed close to Condon since they first worked together on “Kinsey”) and a youth (newcomer Milo Parker, playing a precocious preadolescent eager to be Holmes’ new Watson-like protege).

Like so many celebrated stage actors, McKellen never forgets the great lines of his career. His reunion with Condon calls to mind a gem from “Gods and Monsters”: “Making movies,” he quotes, “is the most wonderful thing in the world — working with friends, entertaining people.”

Really, it’s elementary.