“Three Thousand Years of Longing,” which opens in theaters Friday, may be the year’s most improbable movie. It’s mostly set in modern-day Istanbul and London, yet the story’s basic premise is as old as the “One Thousand and One Nights.” Idris Elba plays a genie — or, as the movie styles it, a djinn — trapped inside a bottle, of course. Tilda Swinton is Alithea, a professor who liberates him and is granted the proverbial three wishes.
The updating of such traditional material is part of the improbability. Superheroes in 2022? Sure, they’re all over the place. Djinns? Not so much. Another is that the director is George Miller. Miller also helped write the script, with Augusta Gore. It’s an adaptation of A.S. Byatt’s short story “The Djinn in the Nightingale’s Eye.” Miller’s best known for directing the four Mad Max movies (two more are on the way). Dystopian futuristic action in the Australian outback is quite a ways, in all sorts of ways, from a tale of a djinn.

Yet Miller has a history of throwing curveballs. Some might argue that he should be best known for his two movies about Babe the pig (he produced and co-wrote both and directed the second). And there are the “Happy Feet” movies, the first of which won an Oscar for best animated feature. Going to a Miller movie, filmgoers are not unlike Alithea buying a certain blue-and-white-striped bottle: Expect the unexpected.
One way to think of “Three Thousand Years of Longing” is as a magic carpet (again, the “One Thousand and One Nights”). Even if it ultimately doesn’t quite take off, it’s a marvel of craft and care and detail. It’s also not quite like anything else. Other than “Everything Everywhere All at Once,” what was the last movie you could say that about?
The title “Three Thousand Years of Longing” refers to the djinn. Much of the movie consists of flashbacks over that span of time, to his three incarcerations. There’s his longing to get out of the bottle, but also longings of other sorts and by other people. In those flashbacks, we meet the Queen of Sheba, who longs for King Solomon; a sultan’s son who does more than just long for zaftig women; and a 19th-century wife in Constantinople who longs to be an astronomer.

The movie has loads of special effects (take that, superheroes), but it also dwells on larger, less visually exciting stuff: myth vs. science — or maybe that should be myth and science — the ramifications of free will, and the nature of narrativity. It matters that Alithea’s field of study is narratology. Even with a supernatural subject and all those special effects, the movie is surprisingly talky — often in a good way (another bit of improbability). Elba speaks with a slight accent of indeterminate origin. Like his pointed ears (!) and shaved head, it flags the djinn’s exoticism. Alithea has an accent, too, which is most definitely determinate in origin, being a Scottish burr. In many respects, the movie is a Swinton-Elba two-hander, and one of its pleasures is hearing them volley accents back and forth.
“Three Thousand Years of Longing” is very much a romance. “What do you wish for?” the djinn asks Alithea. “What is your heart’s desire?” Note that those are not necessarily the same thing. She tells the djinn that she’s “adequately happy and alone, alone by choice.” Here we find romance, or its absence, meeting free will, and its presence. Those two words “by choice” bear an awful lot of weight. So does that adverb, “adequately.” Alithea is clearly under a lot of stress. Arriving in Istanbul, she imagines (or does she?) a troll accosting her at the airport. At the academic conference which has brought her to Turkey, Alithea imagines (or does she?) a pale, menacing unearthly figure in the audience.

“Lately, my imagination has been getting the better of me,” she explains. Partly, that’s in the nature of her work, examining myths and fables and such. Partly, that would also seem in the nature of what has been a life of emotional confinement. It isn’t only djinns who have to endure tight spaces not of their own choosing. The djinn and his liberator share spiritual common ground.
Elba and Swinton are so different — in size, appearance, manner — that they complement each other nicely. His gravity and physicality match her gravity and ethereality. In their opposed ways, both seem slightly unreal. That unreality can take unusual forms. With all due respect to the CGI and Steadicam that Miller puts to excellent use, there may be no better special effect in movies today than Swinton’s blaze of red hair.
Miller is 77, and the film displays an old man’s ease and skill, starting with the assurance of his prowly camera movements. The djinn and Alithea may suffer from confinement. The film they appear in does not. It’s more than just technique, though. Having nothing to prove, Miller can flirt with silliness and embrace idiosyncrasy. Having a lot to offer, he can get away with the one and enjoy the other. He does so with the expert assistance of cinematographer John Seale. Seale shot the last Mad Max movie and first worked with Miller 30 years ago, on “Lorenzo’s Oil” (1992). The more pertinent credit is “The English Patient” (1996), which won Seale a richly deserved Oscar. Here, too, he’s shooting a movie defined by Mediterranean light and that’s as much fable as any sort of standard story.
Put another way: It’s a story — or fable — or romance — or all three — about storytelling. That, too, recalls the “One Thousand and One Nights,” and its narrator, Scheherazade. “I find feelings through stories,” Alithea says. It’s presumably unintentional, but with her elegantly sharp features and severe bob, Swinton bears a resemblance to a much taller Joan Didion. Perhaps that late writer’s single most famous sentence is “We tell ourselves stories in order to live.” That may be why some narratologists — djinns, too — long for them so much.
★★½
THREE THOUSAND YEARS OF LONGING
Directed by George Miller. Written by Miller and Augusta Gore; based on A.S. Byatt’s short story “The Djinn in the Nightingale’s Eye.” Starring Idris Elba, Tilda Swinton. At Boston theaters, Coolidge Corner, Kendall Square, and suburbs. 108 minutes. R (some sexual content, nudity, brief violence). In English, and the occasional Greek or Turkish, with subtitles.
Mark Feeney can be reached at mark.feeney@globe.com.
