The writer-director M. Night Shyamalan shook up the movie world in the late 1990s and early 2000s with beautifully constructed, breathtakingly original films such as “The Sixth Sense,” “Unbreakable” and “Signs.”

For about a decade, and M. Night film was an Event Film. You wanted to see it on opening night, to experience the supernatural journey unfettered before anyone could spoil the twists and turns.

And then, not so much.

Even as the numbers of moviegoers decreased and critics increased with nearly every new Shyamalan release, I stayed with him through “The Village” and “Lady in the Water” and even “The Happening” — but by the time we got to the likes of “The Last Airbender” and “After Earth,” I was off the bandwagon along with just about everyone else.

Here’s the news. With the chilling, creepy, bold and sometimes bat-bleep absurd “Split,” the 46-year-old Shyamalan serves notice he’s still got some nifty plot tricks up his sleeve and he hasn’t lost his masterful touch as a director.

This is a gripping thriller of the mind that’ll make the hairs on the back of your neck stand up. It’s also funny as hell just when it needs to be.

Like “Unbreakable,” the Philadelphia-set “Split” takes a comic book/graphic novel approach, with one foot based in reality and the other crossing the boundary into supernatural conjecture. James McAvoy (the young Professor X in the “X-Men” prequels) is handed a plum of a role and does wonders with it, playing a man named Kevin who has some 23 different and distinct personalities living inside him and taking turns “in the light,” i.e., taking over Kevin’s body. We’ve got the fashion designer Barry, a flamboyant, gentle sort; the intense and smart and physically intimidating Dennis; the 9-year-old mischief-maker Hedwig, and “Miss Patricia,” a gentlewoman of some manners, among others.

Yes, Kevin has Dissociative Identity Disorder, and yes, some mental health advocates are protesting “Split” and calling for a boycott — but it’s difficult to imagine any adult seeing this film and believing for a second it’s an attempt to be a scientific, seriously analytical take on DID, any more than “Psycho” or “Dressed to Kill” or “Identity” or “Fight Club.”

In the middle of the afternoon, Kevin abducts three teenage girls: the popular Claire (Haley Lu Richardson) and Marcia (Jessica Sula), who are close friends, and the outcast Casey (Anya Taylor-Joy), who happened to be in their company at the wrong place and the wrong time.

The three girls wake up in a claustrophobia-inducing underground bunker. (The ingenious set design and the brilliant cinematography by Mike Gioulakis are major contributors to the consistently tense vibe.)

We see Kevin’s various personalities emerge through the eyes of the girls, who alternate between crying and cowering and giving themselves pep talks before trying to escape.

Meanwhile, the personality known as Barry makes frequent visits to Dr. Fletcher (Betty Buckley), who has made a career of treating patients with DID and is a firm believer they are special, gifted human beings with different persons — not different personalities, different persons — occupying their physical shell. (There’s talk of a woman who was blind but regained her sight because other persons within her could see, and a man who could lift three times his weight when a certain strongman within him emerged.)

Casey is so detached and so resigned to the situation, we wonder if she actually knows Kevin and is somehow in on the abduction — but then we learn about Casey’s past through a series of increasingly disturbing flashbacks, and we begin to understand where she’s coming from.

The script calls for McAvoy to hit some big broad notes as an actor, especially when Hedwig becomes Dennis becomes yet another person (I don’t want to say any more) on camera, in close-up. He’s helped by some makeup and a touch of CGI wizardry, but the transitions are mostly in the performances — and it’s a damn good one. When Hedwig or Patricia come to life, we can see how the girls come to believe they’re talking to a 9-year-old boy or a prim and proper woman.

At times potential victims perform classic horror-movie rookie mistakes, whether it’s not taking advantage of an opportunity to escape, or walking deeper into a trap when it’s pretty obvious it’s time to call 911. And when we reach the final 15 minutes or so of “Split” and all is revealed, Shyamalan is taking the kind of chances that no doubt will result in some viewers rolling their eyes.

Not this guy. I went with it. I got back on that M. Night bandwagon, and the finish line in particular was just spectacularly fantastic.

★★★1⁄2

Universal Pictures presents a film written and directed by M. Night Shyamalan. Rated PG-13 (for disturbing thematic content and behavior, violence and some language). Running time: 117 minutes. Opens Friday at local theaters.