One of the most closely guarded secrets in the Marvel Comics universe is Spider-Man’s identity under the mask. For years, the web-slinger kept the secret close to his chest, rarely revealing it to even his closest friends and family. It became not only a staple for the character, but an aspect of him every other superhero acknowledged. When "Civil War" occurred in 2006 and Peter Parker came out and told the world he was Spider-Man, everyone was shocked -- not just because of who he was, but because he’d actually revealed his biggest secret. Of course, with comics being comics, Spidey’s identity in the public eye backfired, and through various shenanigans, Peter eventually put the figurative genie back in the bottle.

It turns out, reality sometimes mimics fiction. That was the case, at least for actor Tom Holland, a.k.a. The Amazing Spider-Man. Forced to go undercover and assume a secret identity in the name of acting, Holland assumed the guise of Ben Perkins and secretly attended Bronx High School of Science in New York City in preparation for his role in the upcoming "Spider-Man: Homecoming."

RELATED:Spider-Man Loses His Suit, Teams with Iron Man In New Homecoming Trailer

“It was a joke I made to Marvel that I wanted to go to a high school undercover to experience what New York high school is really like," Holland revealed in a recent interview with Variety. "They took it very seriously. I went to school for three days and went undercover. I put on an American accent. My name was Ben Perkins. The problem is that Bronx School of Science is for geniuses. You can’t just join halfway through. You have to go through an extensive exam process. A lot of the students were very confused about why I was there, and I think a lot of the teachers were too. So the teachers kept testing me and asking me questions, and believe me, I am by no means a scientist. It was fun and I learned a lot about schools. One of the key characters in the movie, Flash Thompson, was largely informed by my trip. Bullies now aren’t just jocks. They’re rich kids in the nice cars with the fancy clothes. We have a snobby bully rather than a jock bully.”

As for choosing the name Ben Perkins, it turns out that was an unintentional nod to his acting coach. “He was with me at the time in New York while we were there. I went in with another name, but somebody asked me my name, and I panicked and said Ben Perkins. So I went with it.”

And of course, Variety asked the question many other probably found themselves questions: did he ever tell people at the school that he was Spider-Man?

“I told one person on the last day and it spread like wildfire," Holland admitted. "This girl was like, “what’s your deal?” And I said, “I’m Spider-Man.” She didn’t believe me. She just thought I was a nutter.”

Apparently for some, truth is stranger than fiction.

“Spider-Man: Homecoming” follows the events of “Captain America: Civil War.” The film, described as “a coming-of-age story,” finds Peter attending his high school for gifted kids, trying to impress his new benefactor Tony Stark (Robert Downey Jr.) and also dealing with a pesky arch enemy, the Vulture (Michael Keaton).

Directed by Jon Watts (“Clown”), written by John Francis Daley and Jonathan M. Goldstein (“Vacation”) and starring Tom Holland, Michael Keaton, Marisa Tomei, Robert Downey Jr., Zendaya, Donald Glover and many, many others, “Spider-Man: Homecoming” swings into theaters on July 7, 2017.