WARNING: The following article contains spoilers for Spider-Man: Far From Home, in theaters now.

The mid-credits scene for Far From Home featured a surprise appearance from J.K. Simmons as J. Jonah Jameson, once again playing the role after having become synonymous with it during Sam Raimi's Spider-Man trilogy. Director Jon Watts has now explained how that cameo came to be.

RELATED: Far From Home: A Minor MCU Character Just Became Much More Dangerous

In an interview with Collider, Watts was asked about the cameo and how it came to be. He responded, "...we knew that we wanted to reveal Peter’s identity, and we wanted to bring in this idea of the news and not being sure exactly what you can believe or not believe. And it was always going to be him, but we didn’t want to say anything to him or to anyone because we didn’t want any press to leak out about it, via his agents or whatever. So we waited until the very, very last second and called him up, and he came by and he was, ‘Wait, what? You want me to do what?’ It took him a second to understand, but as we pitched the idea he was totally on board and he really loved getting to be the person who finally outs Peter Parker."

Watts revealed the scene itself was also filmed at the last possible minute. “We just set up a green screen in the conference room at Disney and he just came by," the director explained. "It was very strange for him too, because the first take he just launches right into that iconic character and I ruined the take because I couldn’t stop laughing. It was so amazing.”

RELATED: Spider-Man: Far From Home Webs Up Massive Independence Day Weekend

Watts noted the cameo raised some "interesting questions" and opened up "some strange possibilities," though he did not confirm whether the appearance means there's a universe in which the Raimi films exist. "Not really allowed to say," he said, "but I would say that all options are on the table. That’s how I like to think of it."

Directed by Jon Watts, Spider-Man: Far From Home stars Tom Holland, Samuel L. Jackson, Zendaya, Cobie Smulders, Jon Favreau, JB Smoove, Jacob Batalon and Martin Starr, with Marisa Tomei and Jake Gyllenhaal.