WARNING: The following contains major spoilers for Spider-Man: No Way Home, now playing in theaters.

In Spider-Man: No Way Home, as many incursions came over from the Sam Raimi and Marc Webb films, these villains all expressed shock at the existence of magic. Of course, the Marvel Cinematic Universe has already waded deep into it via Doctor Strange and his many associates; however, in one key battle during Peter Parker's (Tom Holland) latest adventure, Marvel Studios has surprisingly unleashed a weapon greater than magic.

It occurred in the first act of No Way Home when Peter stole the magic box containing a spell that was meant to act like a kill-switch, sending the Sony villains back to their respective worlds. Strange had no problem pulling the trigger, as it'd mean his reality would be saved and the fabric of space and time restored, but a sympathetic Peter wanted to "cure" the villains so when they went back, they wouldn't die fighting their versions of the wall-crawler.

RELATED: No Way Home: What MCU Movies to Watch Before the Spider-Man Film

However, when Peter tried to escape the streets near the Sanctum Sanctorum in New York, Strange and his cloak attacked and tossed Spidey into the Mirror Dimension. Introduced in Doctor Strange, this realm essentially allows magic users to practice and fight without exposing themselves to the public, while limiting the damage they can enact in the real world.

Doctor Strange forces SpiderMan out of his body

Here, Strange thought he had the advantage, using a series of trains to destabilize the web-head, as well as cliffs to try to form a trap. Make no mistake, it was a dizzying experience because Peter couldn't escape, knowing Strange had portals that'd basically restrain him to this dimension, but luckily Spidey was a whiz at geometry and quickly figured out what angles to shoot his webs at in this dimension, as it relied on similar mathematical principles.

RELATED: Spider-Man: No Way Home Presents the Doctor Strange 2 Trailer In an Unconventional Way

As such, Peter was able to tie up Strange and slip the sling ring off the sorcerer's hand. Peter was then able to get out of this realm via a portal of his own, and as he took the box away, he dropped a sick burn by letting Strange know math was indeed better than magic.

This should serve as future warning to Strange, because, as learned in the MCU, sorcery and magic are higher sciences, for the most part. Thus, if Peter can expose flaws and loopholes by calculating like this, so too can villains down the line. The cherry on top came when Pete ended up meeting Ned and MJ to leave the box with them, gloating how he defeated his fellow Avenger on his turf in an impressive showing of arithmetic, altruism and ambition.

Directed by Jon Watts, Spider-Man: No Way Home is now playing in theaters.

KEEP READING: Spider-Man: Sony Playing Whac-A-Mole With No Way Home YouTube Leaks