Idris Elba and Tilda Swinton in Three Thousand Years of Longing (MGM)

This clever, surprisingly grounded fantasy-drama takes the concept of the genie-in-the-bottle story as a cautionary tale—be careful what you wish for—and turns it on its head. In the opening scenes, Alithea Binnie (Tilda Swinton), an English professor, lecturer, and expert in the field of narratology, aka the study of stories, arrives in Istanbul for an academic conference. It isn’t long after she has stepped off the plane, however, that she starts encountering fantastical creatures no one else sees.

Yet there is something definitely unexpected about Alithea, who, even after a series of run-ins with such mystical entities, is relatively calm about it all. As she lives a hectic and solitary life, she assumes her imagination is simply running away with itself. While taking a tour of the city, she finds in a random shop a ceramic bottle, which she takes back to her hotel room and rubs vigorously in an attempt to clean it, though instead she frees a giant genie who calls himself simply Djinn (Idris Elba) and offers Alithea three wishes by which she may obtain her heart’s desires.

Alithea, however, is more interested in finding out how Djinn ended up trapped in a bottle, and thus he begins telling tales of love and heartbreak, which spans three millennia via a series of flashbacks. The first involves the legendary King Solomon, who seduces Djinn’s mystical lover away from him and then magically entraps him in the aforementioned vessel. Djinn is subsequently released by a series of women living in different empires and time periods, none of whom ever get to make their third wish (or at least not without triggering a tragedy), which is unfortunate for Djinn: That’s the only way to break the curse of his imprisonment.

Three Thousand Years of Longing is directed by George Miller, who previously helmed the “Mad Max” series of action films, which might make him seem like an odd fit for what amounts to a supernatural romance. But his latest shares something in common with Mad Max: Fury Road. Both films center on a pair of damaged characters thrown together by fate. While Djinn makes it clear early on that he has suffered over the course of his immortal existence, it’s less evident with Alithea (Who plays cool and aloof better than Swinton?), at least until an illuminating sequence in which she casually talks about a failed marriage, and we see what really happened in all of its emotional brutality on-screen.

Miller’s new film lacks elaborate chase sequences that build momentum like runaway trains, which are one of his trademarks, but there is an equivalent propulsive energy, thanks to the recurring use of tracking shots in which the camera hurtles through space, down tunnels, and even through walls. Similarly, despite most of the scenes between Alithea and Djinn taking place in the same hotel room, their story line always feels like it’s building toward something. It helps that the script introduces high stakes if Alithea doesn’t make a wish.

The action eventually moves on from both the suite and the film’s version of Istanbul, where the fantastical runs amok, back to London, at which point Miller’s visual palette becomes relatively washed-out and the film’s tone more somber. Yet the change never feels jarring. By this time, the protagonists have become sufficiently fleshed out. Djinn, in particular, grows into a character of surprising depth and vulnerability to the extent he’s as “real” as Alithea. Meanwhile, the extensive conversational scenes between the pair help them to reach a happy median between the rational and magical, the mind and heart, when it comes to the prospect of having wishes fulfilled.

However, the episodic structure results in the movie becoming dramatically unsatisfying at times—there are many loose ends and characters whose fates go unresolved as the narrative jumps from one era to another—but overall, this is a smart fantasy film with some astonishing visuals. (At one point, Djinn offers someone a glimpse of infinite knowledge—a series of geometric shapes and lines extending towards the limits of the screen. It’s certainly a novel interpretation of the concept.) Combined with a few Game of Thrones–level scenes of brutal violence, which should assure Miller fans that he hasn’t lost his touch for mayhem, it is, in short, everything fans of the genre could wish for.

Directed by George Miller
Written by Miller and Augusta Gore, based on the short story “The Djinn in the Nightingale’s Eye” by A.S. Byatt
Released by MGM
Australia/USA. 108 min. R
With Idris Elba and Tilda Swinton