James McAvoy is set to star in M. Night Shyamalan's follow-up to the surprise hit "The Visit."

According to Variety, the "X-Men" actor was cast after a deal couldn't be made with Joaquin Phoenix, who appeared in Shyamalan's 2002 sci-fi thriller "Signs."

The mystery project will reunite the filmmaker with Blumhouse Productions, which produced "The Visit" for $5 million; it's grossed $67.4 million worldwide. Production is set to begin next month in Philadelphia.

McAvoy will next be seen starring opposite Daniel Radcliffe in "Victor Frankenstein," followed in May by "X-Men: Apocalypse."