Michael Jackson enjoyed an unusually intense cult following in the Arab world, his albums circulating like underground samizdat in regimes that banned Western pop music. In later life, fleeing legal and financial problems at home, the troubled superstar briefly found sanctuary in the Gulf state of Bahrain, where he reportedly looked into converting to Islam. The singer's ghostly presence hangs heavy over Sheikh Jackson, an agreeably off-the-wall drama from Saudi-born Egyptian writer-director Amr Salama, which Egypt has chosen as its Academy Awards contender in the best foreign-language film category.

Salama, who previously won festival awards for Asmaa (2011) and Excuse My French (2014), uses playful juxtapositions and time-jumping plotlines to make serious points about compassion, generational friction and family dysfunction. Selected to close the Special Presentations section in Toronto, Sheikh Jackson is a culture-clash curio that hits a few duff notes, but never wants for quirky charm. The Jackson angle and Oscars connection should guarantee further festival bookings, with London and Rome already due to host screenings in October, boosting word-of-mouth buzz and modest theatrical potential on the wider global stage.

One of the film's two interwoven timelines takes place in the city of Alexandria in 2009. A respected pillar of his community, conservative preacher Sheikh Khaled Hani (Ahmad Alfishawy) lives a joylessly strict life, even sleeping beneath his bed as a constant reminder that death is forever close at hand. Khaled insists that his wife wear a full veil in public, cajoling her with passive-aggressive pieties: "I love you because I know you love God more than you love me." On finding his daughter watching Beyonce videos online, he warns her against the sinful perils of "dirty dancing" and "diabolical music."

But the shock news of Michael Jackson's death reveals a hidden side to the puritanical Sheikh. Flashing back to the early '90s, we meet the young Khaled (Ahmed Malek) when he was a huge fan of the pop superstar, mocked by his classmates for mimicking Jackson's hair and dance moves. His macho, domineering father (Maged El Kedwany) berates him for his love of the "drag queen" superstar, too. But Khaled's very public musical passion also earns him female attention at school, where young love blossoms.

Jackson's death leaves the adult Sheikh shaken, questioning his religious faith and life choices. It also throws up painful memories of his mother's death, his father's cruelty and his thwarted classroom romance. He begins to suffer nightmares and hallucinations, including spooky Shakespearean visitations from Jackson himself (played by professional MJ impersonator Carlo Riley) during prayer sessions at his mosque. Teetering on the verge of a nervous breakdown, he consults a psychotherapist and begins tracking down estranged figures from the past, hoping to achieve some kind of closure on his childhood traumas.

Sheikh Jackson is a little too somber and straight-faced for its goofy premise, its protagonists often unsympathetic, its tone sometimes corny and melodramatic. But it is also an offbeat charmer that boldly sets up its bizarre conceit and runs with it. In one bravura sequence, the working rhythms of a car repair shop become a syncopated musical number. In another, Khaled gets lost in a feverish dream montage of scenes borrowed from Jackson's video canon, with key figures from his life playing the main roles. Considering each of the original videos probably had a budget larger than Salama's entire film, these visual homages inevitably lack the same blockbuster luster, but their ambition is admirable.

The sole serious deficiency here is a total absence of any Michael Jackson music. Unable to license any original songs, Salama is forced to fall back on Hani Adel's pastiche score, a weak approximation of the late star's whooping, propulsive, high-gloss sound. Adel's music becomes particularly cloying during the finale, when Khaled lays the ghosts of the past to rest a little too glibly before moonwalking off into the sunset. The women are also too thinly drawn in this carnival of male angst, most of them Islamic Pixie Dream Girls with little agency or personality. But beyond these niggling flaws, Sheikh Jackson still emerges as an endearingly offbeat and humane parable about the liberating power of forgiveness, starting with yourself.

Venue: Toronto International Film Festival (Special Presentations)
Production Companies: Film-Clinic, The Producers, I-Productions
Cast: Ahmad Alfishawy, Maged El Kedwany, Ahmed Malek, Amina Khalil, Basma
Director: Amr Salama
Screenwriters: Amr Salama, Omar Khaled
Cinematographer: Ahmed Beshary
Editor: Ahmed Hafez
Producers: Mohamed Hefzy, Hani Ossama
Production Designer: Hend Haidar
Music: Hani Adel
Sales company: Media Luna
93 minutes