SPOILER WARNING: The following contains major spoilers for M. Night Shyamalan's Glass, in theaters now.

After a some cinematic flops, M. Night Shyamalan got back on the path to success two years ago with Split, which audiences discovered n a post-credits scene was actually an unofficial sequel to his 2000 film Unbreakable. In theaters this weekend, Glass serves as the final act of the trilogy, with Bruce Willis' David Dunn, a veritable man of steel, facing off against James McAvoy's Kevin Wendell Crumb and his multiple personalities, namely the super-strong Beast.

RELATED: Glass - Shyamalan's Fragile Twist, Explained

However, with both superhumans institutionalized at the Raven Hill mental facility under the care of the mysterious Dr. Ellie Staple (Sarah Paulson), the villainous Elijah Price (Samuel L. Jackson) from Unbreakable demonstrates he's a master manipulator by pulling everyone's strings in a finale set up to change the world in which they live.

LOVE CONQUERS THE BEAST

Elijah, aka Mr. Glass, frees the Beast, but as they escape the institution on a terrorist mission to eveal to the existence of superhumans to the world, they're confronted by David. But that was part of Elijah's plan, as he believes David and the Beast will push each other to their limits, causing them to further evolve to survive. However, David's son Joseph (Spencer Treat Clark) steps in and reveals to the Beast that the accident that killed Kevin's father and helped to fracture his psyche was the same train crash David survived in Unbreakable, meaning Elijah was responsible for his death.

RELATED: M Night Shyamalan's Movie Twists, Ranked

Elijah views the coincidence was fate, as it allowed him to create not one, but two superhumans. That revelation naturally doesn't go down well with the Beast. With David incapacitated after nearly being drowned in a tank of water (his weakness), the enraged Beast punches Elijah, breaking his bones and mortally wounding him. Shockingly, as the Beast leaves to carry out his attack on the city, Casey (Anna Taylor-Joy), his kidnapping victim from Split, grabs and hugs him.

She believes warmth, emotion and human connection, which he never received from an abusive mother, will liberate Kevin from the Beast's grip. As she theorized, her actions free a repentant Kevin.

THE TRUE SUPERVILLAIN REVEALED

Sadly, just as Kevin regains control of his mind, he's shot by a sniper, which leaves him bleeding out and gasping his last breaths. In his final moments, all of his personalities emerge, and either apologize for the chaos they have caused or else express fear of an impending death.

RELATED: Unbreakable Was the First Post-Modern Superhero Movie

Casey is left in tears because, after repaying Kevin for freeing her from the Beast's captivity in Split, she realizes her effort to break him from his mental prison was, ultimately, all for nothing. It turns out the order to kill Kevin came from Ellie, as the audiences discovers her plan wasn't to cure these people, but instead to keep their superhuman abilities a secret.

Revealed as a villain, Ellie has her goons finish the job, and drown David in a pothole even as Elijah bleeds out in front of her and his own mother. As Elijah says in his final words, these superhumans weren't "accidents"; they deserved better. His mother underscores that by observing how "special" they were.

EXPOSING THE TRUTH

However, even in death, a true mastermind has contingency plans in place, and Ellie finds out in the closing moments that Elijah was indeed the architect of the entire story. As she wanders a comic book store, seemingly taking pride in her victory, she overhears kids talking about villains doing their most damage from the afterlife. Growing suspicious, she returns to Raven Hill, where she realizes Elijah actually captured every bit of footage of the big battle from throughout the facility.

REVIEW: Glass Fails to Effectively Close Out Shyamalan's Superhero Trilogy

Ellie had installed more than 100 cameras after Elijah kept sneaking out during confinement, and she now realizes he had orchestrated everything: from the cameras to the escape route he took with the Beast to the fight outside the compound. He was determined to collect all of the evidence he needed to prove their existence to the world, and foil any attempts of a cover-up.

Ellie discerns that Glass never intended to escape in the first place; this was a suicide mission. Her control room discovers that even though they deleted the footage, Elijah secretly uploaded it to David's son, Casey, and his mother, so they could make it public. The film ends with the the footage now being viewed by the public, on mobile devices and on TV news broadcasts, which leads Ellie to break down, as all of her hard work to keep these men, and their abilities, a secret has been shattered.

Directed and written by M. Night Shyamalan, Glass stars James McAvoy as Kevin Wendell Crumb/The Beast, Bruce Willis as David Dunn, Anya Taylor-Joy as Casey Cooke, Samuel L. Jackson as Elijah Price/Mr. Glass and Sarah Paulson as Ellie Staple.