M. Night Shyamalan’s “Split” has turned into a horror hit with a surprisingly strong $40.2 million in its opening weekend at 3,038 North American locations.

“Split,” starring James McAvoy as a man with 24 different personalities, performed far above recent expectations for Universal and Blumhouse. It easily topped the 2015 launch of Shyamalan’s found-footage horror movie “The Visit,” which scored an opening weekend of $25.4 million.

“Having M. Night Shyamalan’s name on the title means a lot, because his fan base is so devoted,” noted Universal’s domestic distribution chief Nick Carpou. “He’s the master of the plot twist.”

Carpou noted that “Split” showed plenty of drawing power in all demographics with the 52% of the audience being female and 52% under 25 and should perform well in coming weeks. “As a psychological thriller, this should have a lot of playability,” he added.

“Split” doubled Vin Diesel’s launch of “xXx: Return of Xander Cage,” which is heading for a second-place finish for Paramount with $20 million at 3,651 sites — in line with recent forecasts. Fox’s historical drama “Hidden Figures” maintained its impressive performance in third with $16.3 million at 3,416 theaters for a domestic total of $84.2 million.

Michael Keaton’s biopic “The Founder” showed little traction for the Weinstein Company with a modest $3.8 million weekend at 1,115 locations.

Shyamalan produced and directed “Split” from his own script in which McAvoy’s multiple characters capture three young women and hold them hostage. The movie, which costs under $10 million, generated the fourth-highest opening for a Shyamalan title following “Signs” with $60 million, “The Village” with $50.7 million, and “The Last Airbender” with $40.3 million.

“Split” carries a 76% rating on Rotten Tomatoes, with McAvoy’s performance receiving strong reviews. Shyamalan is self-financing the project and re-teamed with horror specialist Jason Blum and his Blumhouse Productions after collaborating on “The Visit,” which grossed nearly $100 million worldwide on a $5 million budget.

“Xander Cage” stars Diesel as a skilled government operative character who debuted in the 2002 movie “xXx.” The film also stars Samuel L. Jackson, Donnie Yen, Deepika Padukone, Ruby Rose, Kris Wu, Tony Jaa and Nina Dobrev.

D.J. Caruso directs from a script by F. Scott Frazier, which centers on Diesel’s Xander Cage coming out of self-imposed exile in a race to recover a seemingly unstoppable weapon known as Pandora’s Box.

“Xander Cage” has an $85 million budget with backing from Chinese companies Huahua Media and Shanghai Film Group, which limits Paramount’s exposure to about 50%. Paramount and the two companies announced a three-year $1 billion co-financing deal on Thursday.

Paramount distribution chief Megan Colligan that the multi-national and multi-ethnic cast proved to be a major plus for the pic, which the audience 25% Hispanic, 17% African-American and 14% Asian-American.

“Hidden Figures,” which won the first two weekends of 2017, held well with a 22% decline during the three days. The drama may be a major beneficiary from Tuesday’s Academy Awards nominations.

Illumination-Universal’s fifth weekend of “Sing” led the rest of the pack in fourth with $9 million at 3,193 locations for a 33-day take of $249.4 million. Lionsgate’s awards contender “La La Land” finished a close fifth with $8.4 million at 1,865 sites to push its total to nearly $90 million.

Disney-Lucasfilm’s sixth weekend of “Rogue One: A Star Wars Story” and Paramount’s second weekend of “Monster Trucks” were in a tie for sixth place with $7 million each. “Rogue One” has now hit $512 million at the domestic box office (seventh on the all-time list) and has hit $1 billion worldwide.

Paramount’s parent Viacom has already taken a $100 million writedown on “Monster Trucks,” which declined 36% from its inauspicious opening weekend. The family adventure, which carries a $120 million price tag, has grossed $22.6 million domestically in its first 10 days.

Lionsgate-CBS Films “Patriots Day” finished in eighth with $6 million in its second weekend in wide release at 3,120 sites, lifting the Mark Wahlberg drama to a $23.6 million total. TWC’s “The Founder” followed in ninth with $3.8 million at 1,115 locations with President David Glasser noting that the studio is seeing strong word of mouth and is eyeing the possibility that Michael Keaton could receive an Academy Awards nomination on Tuesday.

“We have hopes that with a nomination for Michael on Tuesday, it will further the audience for the movie,” he added.

Two titles in their second weekends were battling for the 10th spot with Open Road’s “Sleepless” with $3.7 million at 1,803 sites edging STX’s “The Bye Bye Man” with $3.6 million at 2,220. “Sleepless” declined 56% while “The Bye Bye Man” plunged 74% in face of the massive “Split” opening.

Paramount’s doubling of the run of Martin Scorsese’s religious drama “Silence” generated little traction with $1.2 million at 1,580 sites. “Silence” has taken in a mild $5.2 million in a month.

BH Tilt’s opening of faith-based “The Resurrection of Gavin Stone” also was quiet with $1.4 million at 887 locations.