Fox’s hotly anticipated sci-fi series “The Flare” gets its own after-show, “What Just Happened??! with Fred Savage, ” premiering Sunday night.

Well, sort of.

In reality, “The Flare” is a fictional show, but it’s the template for “What Just Happened??!” (9:30 p.m.), an homage to after-shows and late-night talk shows that really is hosted by Savage, who created the nine-episode comedy series with Dave Jeser and Matt Silverstein.

“For us, the pitch was always, ‘It’s an after-show about a show that doesn’t exist,’” says Savage, 42. “That was enough to get people to lean forward, and once we got them to lean forward, we had the opportunity to dive in a little deeper. ‘The Flare’ was part of it from the initial pitch. We wanted to think of a watercooler-moment type of show . .. that would generate the fandom that would justify an after-show.

“‘What Just Happened??!’ also borrows a little DNA from a few different genres of shows including a late-night talk show component: I have a co-host (comedian Taylor Tomlinson), a house band [indie LA duo Best Coast], celebrity interviews and remote bits — we borrow from early Letterman and Conan with comedic pieces out in the field.

“So while ‘The Flare’ is our launching point and sets the tone thematically for each week’s episode, we use it as a springboard to explore other avenues of fandom.”

In the world of “What Just Happened??!,” Savage is a huge fan of (fictional) writer TJ Whitford’s sci-fi book series, “The Moon is the Sun at Night,” about a solar event that throws the blue-collar town of Milford, Ill. into a “post-apocalyptic battle for human survival.” Fox has adapted Whitford’s books into “The Flare” with a cast including (real-life) actors Shiri Appleby, Tyler Ritter and Kevin Zegers.

Each episode of “What Just Happened??!” opens with the final minutes of “The Flare” leading into the after-show — with Savage and Tomlinson dissecting “what just happened” with celebrity guests including Rob Lowe, Tiffany Haddish, Joel McHale, Vince Gilligan and Ken Jeong. “We’ve cast ‘The Flare,’ written it, shot it — it’s a real show, it just exists a few minutes at a time,” Savage says. “The episodes always end in a great moment of suspense or excitement or high drama, which is minimized in the bottom corner of the screen and leads right into our show.”

Savage says the series evolved after Fox approached him about two years ago with an offer to host a talk show. “I was like, ‘I don’t know if I would want to do a straight talk show,’ but that kind of planted the seed,” he says. “I was meeting with Dave and Matt … trying to find something to collaborate on and we married two different ideas we had and started to build out this world. It’s something that got us excited and made us laugh. We said, ‘Fox will never let us do this’ and they did!”

Savage shot a pilot episode last year, and the series sat on the shelf until it got the green light from new Fox chief Charlie Collier, whose experience with after-shows dates back to his days at AMC — including “Talking Bad,” which followed “Breaking Bad” and “Talking Dead,” which follows “The Walking Dead.”

“I think the proliferation of after-shows really gives us the standing to be able to do this,” says Savage. “Over the last three-to-five years they’re just everywhere so people have a real awareness that this is a real show genre.

“They can fully buy into our show.”

“What Just Happened??! with Fred Savage” Series Premiere 9:30 p.m. Sunday on Fox