The “Arrowverse” saved its biggest surprises for the final two hours: TV’s Barry Allen (played by Grant Gustin) met big-screen Barry Allen (played by Ezra Miller).

But that wasn’t all, as the five-hour event concluded with the death of Oliver Queen (Stephen Amell), whose Green Arrow kicked off the DC franchise on the CW, and the multiverse combined into an Earth Prime.

“We knew from last year, quite frankly, that we were going to merge and create Earth CW,” “Arrowverse” executive producer Marc Guggenheim said. “But Earth Prime sounds better. So all the CW shows will be on the same earth.”

Here, Guggenheim talks with Variety about how the “Arrowverse” brought Miller to the DC/CW universe, killing off Oliver (twice), and rebooting the shows.

There has been a fairly strict separation of the DC film and television world. How were you able to combine the two with Miller’s cameo?

We were series wrapped on “Arrow,” and we were wrapped on the whole crossover. We were in post and some episodes were locked, and some were soft-locked. I got a phone call from [Warner Bros. boss] Peter Roth saying, “I know you’re locked, but can you put Ezra into the crossover?” And I said, “Yes.” And he said, “How, you’re series wrapped? And you’re wrapped on the crossover.” And I said, “Yeah, I know, but if you’re telling me Ezra Miller can be in the crossover, I can make it happen.” I called Eric Wallace who who is the showrunner of “Flash,” and he called up Grant Gustin — because the one thing that was our only concern was the thought we didn’t want to do it unless Grant was 100 percent onboard with it. And he was. He was incredibly enthusiastic and onboard with it. And then we got on the phone with Ezra Miller and told him the scene I had written and he was completely into it. And we just went. We put together a unit of the “Flash” crew on the “Flash” set [since “Arrow’s” team, which had produced the rest of the hour, was gone]. And much to our surprise, no one noticed Ezra Miller was in Vancouver and no one leaked it from the crew, which we appreciate. So we were able to keep it a surprise.

Combining the multiverse made it so there was only one version of each hero left. Does that mean that Miller’s Flash no longer exists in the DC television world?

I will leave that question to Warner Bros. and DC. They have a wonderful vision for not just Ezra’s Flash, but also the entire DC universe. Jim Lee is the man to talk to.

Oliver ended up dying twice over the course of the crossover. What led to the decision to pull that figurative trigger twice?

The creative behind it was we were faced with the question of how do we surprise the audience when we spoiled the story [a year ago]. The creative conversations were pretty simple. I shared that plan with [executive producer] Greg Berlanti, who was into it. And then I pitched it to Stephen, and Stephen and I have been talking about, for years, that the end of the “Arrow” story is [Oliver’s] death. And we’ve always been on the same page. I think he enjoyed A) the opportunity to play two death scenes and B) the creative sleight of hand in terms of surprising the audience. That’s the other thing that Stephen and I have always agreed on: surprising the audience with the unexpected. So it just made sense. The only lingering question was if we kill off Oliver in [“Arrow”] Season 8 Episode 8, what’s the series finale? And we had a plan for that as well.

The introduction of Earth Prime has led to new changes, like baby Sara’s return, Lex Luthor a hero, etc. How will the shows be handling the reveal of the differences going forward? And for a character like Laurel (Katie Cassidy), whose Earth-1 Laurel was killed and has been playing Earth-2 over the past few years, which version is left?

Certainly the question of which Laurel is left is going to be answered very definitively in [“Arrow’s”] Season 8 Episode 9. But the explanation for the result is given very strong in Episode 10. We went into the crossover knowing we would end with the combing of the Earth, and the reboot of the universe. And the way we sort of saw that there is an opportunity going forward after “Crisis” to slowly reveal all of the weird changes. [“Arrow” showrunner] Beth Schwartz and I went into the crossover knowing in the final episode that we wanted to reveal that baby Sara, who was eliminated in “Flashpoint,” was returned to the timeline. That was very important to us. We had actually considered doing it after “Elseworlds” last year, actually, but thought it had more punch if it was a part of the universal reboot of “Crisis.”

Lex seems to be a wild card, and now he has history with characters from all of the “Arrowverse” shows. What’s next for him?

That’s really a question for the “Supergirl” showrunners. I went to them, I said we’re going to do a reboot, we’re going to combine the universes, anything you want to introduce to your shows, now is a really, really good time. And this was something that [“Supergirl” showrunners] Robert Rovner and Jessica Queller came back with. We were all really excited about it.

The “Arrowverse” characters have long been interconnected, but now they’re all residing on the same Earth. How does that change the stakes for things going forward when the shows have to remain quasi-separate?

I think the Marvel [film] universe deals with it every time[, too,] like in “Iron Man 3” — why doesn’t Tony Stark call upon the Avengers? We’ve had this issue ever since we introduced Flash into the “Arrowverse.” Why doesn’t Oliver call upon his super-powered friends? The way we tend to solve that problem, historically — and I don’t think this will change post-“Crisis” — is when it’s appropriate, story-wise, and doesn’t feel like a departure we’ll mention, “Why don’t you call in [another hero]” and give an explanation.

The very end of the crossover hinted at the introduction of Gleek and the Wonder Twins. Is that something that fans can look forward to on “Legends of Tomorrow,” the next crossover or sometime TBD?

TBD. That was something where we knew we wanted to end with that fun bit. There were early versions of the draft that had the Wonder Twins actually in it. I consider the Wonder Twins kind of a jump ball: We’ll see what show wants to grab it.