When we first meet James McAvoy in M. Night Shyamalan’s tense and unnerving new horror film, he seems like a prissy nutjob who just happens to kidnap three high school girls (Anya Taylor-Joy, Haley Lu Richardson and Jessica Sula) from a birthday party. He keeps them captive in what looks like a shabby underground room, warning them not to try and escape. Each time he unlocks the door and returns to the room, his personality is entirely different: He’s a playful little kid one time, a classy woman another, a fashion designer yet another. What’s up with this guy? For those who’ve overlooked the movie’s pretty obvious title and avoided the trailer, the answer becomes clear once we see the hero with his therapist, who is played wonderfully by Betty Buckley even when she has to deliver payloads of exposition. 

It turns out that in the action so far, we’ve only met a few of Kevin’s 23 constantly-at-war personalities, all of whom may soon be dominated by an entirely new one called (cue the shrieking violins, please) the Beast. To reveal much more would spoil the best of Shyamalan’s bag of tricks—a bag that contains deft jolts, cheap scares, nerve-jangling atmosphere, B-movie half-undressed teen titillation and delightfully over-the-top theatricality. Apparently replacing Joaquin Phoenix, McAvoy—stage trained, truly gifted and mostly misused in movies so far—looks like he’s finally having the time of his life playing so many twisted roles. His joy and liberation practically leap off the screen. He’s obviously and respectfully nodding to silken, scary movie predecessors played by Anthony Perkins in Psycho and Anthony Hopkins in The Silence of the Lambs, but he’s better here than he’s been since Atonement because he’s complex and oddly sympathetic—in addition to being a deeply creepy lunatic. 

As Casey, a loner and survivor of a rough childhood, Anya Taylor-Joy (The Witch) is excellent, too, especially in scenes illuminating her troubling backstory and, back to the present, when her fight to survive captivity becomes a cat-and-mouse battle of the wills with the wildly unpredictable Kevin. Both characters are so riddled with ghosts from the past that it’s tough to say which of them could possibly recover, let alone win.

Shyamalan has been on shaky ground for well over a decade, but here, clearly directing on a tight budget, his work feels confident and nervy. He handles the claustrophobic sets and atmosphere as shrewdly as he does the therapy scenes between McAvoy and Buckley—the very best things in the movie. It’s the work of a boss getting his groove back. If some of the writer-director’s theories on dissociative identity disorder seem invented on the spot, purely for plot purposes, it’s all part of the spirit of wicked, macabre fun, although mental-health advocates are already in an uproar. 

Nicely shot by Mike Gioulakis (It Follows), Split keeps us riveted, laughing, jumping out of seats and guessing right to the end. It’s a nasty little piece of work, Shyamalan’s best in forever, and a juicy, macabre pleasure to watch.