Ah, the eternal problem of the spoiler warning… You never want to give away too much plot in a film review – but then, plot isn’t always the biggest thing that you would ideally want to keep fresh for the viewer. In Jeff Nichols’s Midnight Special, two of the biggest surprises are particular visual effects, so I’ll disclose just one, namely that this terrific American science fiction/thriller hybrid does some (literally) dazzling things with a certain shade of blue light.

Midnight Special is the fourth feature by Jeff Nichols, the Arkansas-born writer-director who has rapidly established himself as an inventive, independent-minded talent with a firm belief in old-fashioned storytelling values. His 2007 debut, Shotgun Stories, a modest but taut family feud drama, helped establish its star, the ever-unsettling Michael Shannon, as one of the most striking presences in American cinema. Nichols and Shannon worked together again in Take Shelter, an eerie domestic tale with an apocalyptic edge, and in Mud, a modern, Huckleberry Finn-style boys’ adventure.

Now they reunite for Midnight Special, which sees Nichols taking a leap into very unexpected territory. The film seems to start in familiar road-trip thriller mode, but little by little, Midnight Special leads us towards a spectacular final-act reveal. What Nichols pulls off here will, for some, fall squarely into the WTF category, but for just about everyone, it will be altogether WJH (What Just Happened?), so audacious is its climactic flouting of established genre boundaries.

At the start, two hard-bitten characters – Roy (Shannon) and Lucas (Joel Edgerton) – are holed up in a motel room with an eight-year-old boy named Alton (Jaeden Lieberher), whom they seem to have kidnapped. In fact, Alton is Roy’s son, and he’s a very unusual child who must be kept in pitch darkness because of his singular talents – and the dangerous intensity of his blue eyes isn’t the half of it. While the trio are on the run and trying to reach Alton’s mother, Sarah (Kirsten Dunst), they are being pursued by a religious cult led by Calvin Meyer (Sam Shepard, making a steely, imposing arch-patriarch), who believes that the boy’s enigmatic utterances are divine revelations, although they turn out to be something odder still.

The chase is joined by the FBI, a sympathetic National Security Agency analyst played by Adam Driver, and Meyer’s emissary, Doak, played by Bill Camp. One of the best character actors in current US cinema – he was Brian Wilson’s domineering dad in Love & Mercy – Camp excels at playing nondescript, careworn, middle-aged men, and his presence is one of the touches that make Midnight Special so distinctive. Sent out armed on what Meyer tells him is a holy mission, Doak laments, in one of the year’s best lines yet: “I’m an electrician, certified in two states. What do I know about these things?”

The narrative fairly rattles along with a focused momentum that recalls the great hard-boiled Hollywood thrillers of the 70s, with Shannon and Edgerton like dual Clint Eastwoods in their characters’ laconic determination to get Alton to his prophesied destination. Along the way, though, as they careen through assorted motel showdowns and white-knuckle traffic incidents, we realise that the narrative is steering us into strange and unfamiliar territory, into the zone of what you might call signs-and-wonders science fiction, as practised by early Spielberg and by John Carpenter in his 1984 movie Starman.

Even if these references hint at the sort of story that Midnight Special tells, what you won’t see coming is the genuinely extraordinary coup de cinéma that Nichols pulls at the climax, about which I’ll say only that, after years of brain-numbing visual bombast from Hollywood, here is a sequence that restores your faith in the capacity of special effects to achieve real grace, strangeness and beauty.

What makes Midnight Special so authentically special is the way that, like Spielberg in Close Encounters of the Third Kind, Nichols contrasts his story’s cosmic dimension with gritty-realist mundanity – all those grim motel rooms, gas station forecourts and back roads, their drabness vividly captured in Adam Stone’s widescreen photography. It’s also a movie in which a top-grade bunch of actors get stuck in with self-effacing pragmatism, not getting overpowered by the story but not trying to outshine it either. Nichols is served superbly by Dunst, Edgerton, Shannon and a winning Driver, who was surely born to play sympathetically bemused boffins. As for the outright strangeness of wunderkind Alton, it’s nicely offset by the casting of Lieberher, a child actor who’s impressive but essentially down to earth in his manner.

Overall, this is a tremendous film – narratively satisfying, visually striking, and with a teasing theological subtext, if that’s your bag. Besides, how often do you see a movie in which Michael Shannon’s aren’t the weirdest eyes on screen?