J.J. Abrams’ Star Trek movie reboot drew mixed reactions from long time fans. Some enjoyed the way Abrams created an alternate timeline by having Ambassador Spock and a 24th-century Romulan ship alter the lives of Captain Kirk and his crew. The changes allowed this new timeline to evolve unhindered by past Star Trek continuity. On the other hand, other fans disliked this as it seemed to erase decades of storytelling and potentially wipe out favorite Star Trek characters like Picard and Sisko.

However, one Star Trek comic storyline that ran in Star Trek #35-40 revealed that although the new universe (designated the “Kelvin Timeline”) had been radically altered, some things refused to change. By re-introducing fan-favorite characters like Q, readers learned that their favorite Deep Space Nine characters existed in the Kelvin Timeline, albeit in slightly different forms.

Related: Doctor Who vs. Star Trek: Which Universe Is More Dangerous?

The story, “The Q Gambit” actually begins in the “Prime” Timeline in which shows like Star Trek: The Next Generation and Star Trek: Deep Space Nine took place (and reassuring the reader that Ambassador Spock’s actions did not erase his universe). Functioning as a quasi-sequel to the Star Trek: Countdown series, which followed Spock’s efforts to recruit Jean-Luc Picard (now ambassador to Vulcan) and a resurrected Data (now captain of the Enterprise) to help him save Romulus from a supernova, the miniseries ended with Spock being sucked into the time warp singularity and Picard mourning his loss.

Star Trek Picard Q

However, Picard soon receives an unexpected visitor in the form of Q who informs his old frenemy that Spock lives in an alternate timeline created by his accidental trip through time. Unfortunately, Q also states that Spock’s actions also doomed the new Kelvin Timeline’s future. When Picard refuses to get involved, Q vanishes, promising to set things right… in his own way.

In the Kelvin Timeline, Captain Kirk and his crew are finally hitting their stride, following the events of Star Trek: Into Darkness. Their efficiency is tested, however, when Q secretly puts them through his own version of the Kobayashi Maru, destroying the Enterprise (only to restore it again moments later). Appearing before Kirk, Q informs him that his crew will inevitably experience a no-win scenario in the near future. When Kirk predictably scoffs at the idea, stating he doesn’t believe in no-win scenarios, Q transports him to the 24th-century where the Enterprise comes face-to-face with Deep Space Nine.

Related: Star Trek Hints Q Will Return In Picard Series

However, this is not the Deep Space Nine fans are familiar with, nor is this the 24th century they know from the movies and television shows. Turns out that by removing Kirk and the Enterprise from their proper time, Q created another alternate timeline – one where the Klingons managed to conquer Earth and the United Federation of Planets is no more. Without Starfleet to help secure the space station, Deep Space Nine remained occupied by the Cardassians (and continued to be referred to as “Terok Nor”).

Understandably confused, Kirk and his crew are taken aboard the station where Kirk gets to meet its commander – Gul Dukat. Thrilled to have a historical ship like the Enterprise in his possession, Dukat throws Kirk, Scott, and Uhura into a cell where they learn they have an unexpected cellmate – Benjamin Sisko. While this Sisko is not the Starfleet captain fans know, he’s still a capable man, as revealed when he escapes his cell with the help of his shapeshifting friend Odo and takes Kirk aboard the Defiant.

Q also continues to appear periodically to inform/taunt Kirk about the forthcoming “unwinnable scenario.” The Defiant ends up going to Earth which is now under Klingon rule and called “Tera.” En route, Sisko explains that having grown up under a Klingon flag, he ended up joining the “Human Auxiliary Corps” to fulfill his dream of going to other worlds. This allowed him to become a cargo pilot shipping supplies and information throughout the Klingon Empire.

Related: Star Trek’s Captain Janeway Is Pirate Queen Of The Mirror Universe

Secretly, however, Sisko is also a member of the Free Federation Resistance, a resistance group that still upholds the ideals of the Federation. Sisko’s status as a valuable member of the Klingon Empire gives him greater access and mobility, including an audience with Tera’s Supreme Commander – Chancellor Worf. Although Worf proves surprisingly friendly with Sisko and Kirk, he is ultimately killed by his brother, actually, a Changeling masquerading as a Klingon who reveals the Dominion is now taking over Earth.

Meanwhile, Spock and Doctor McCoy (along with the rest of the Enterprise’s science officers) are still held prisoners aboard Terok Nor and eventually sent down to Bajor to work in its camps. They gain some allies of their own, however, in Doctor Bashir and his friend Quark who smuggles Spock and McCoy out of the camp. As it happens, Bashir, Quark, and the Bajoran Kira Nerys are all working with the resistance. Kira is also able to take McCoy and Spock to an ancient Bajoran tablet that has two spirits locked inside – a Pah-Wraith and a Prophet.

Zachary Quinto & Chris Pine in Star Trek

Kira hopes to free the Prophet in hopes that it will help them win the war against the Dominion, which seeks to take over the Alpha Quadrant. Unfortunately, Quark sells out his friends and allows Gul Dukat to take control over the tablet. Dukat breaks the tablet, freeing both spirits and becoming host to the Pah-Wraith. Meanwhile, the Prophet escapes and finds a host in Sisko who had escaped the Dominion and managed to find his son Jake along with his friend, Jadzia Dax.  Feeling they have a chance to win the war now, Kirk convinces everyone to use the Defiant to return to Terok Nor with the empowered Sisko.

Unfortunately, Dukat, now drunk on his own power, decides to take over the Cardassian Empire and the Dominion on his own. He also attempts to draw Sisko into the wormhole around Terok Nor, believing the Pah-Wraiths inside will destroy the Prophet. Q then appears, revealing that Kirk is finally at the no-win scenario he discussed. However, Q then reveals an additional wrinkle – he engineered all of this in hopes that Kirk would find a way out of this situation as it affects the Q Continuum itself.

Related: Star Trek Theory: Picard Is Using Doctor Who Technology

Turns out that although the Q are omnipotent, they are still vulnerable in a multi-dimensional war between the Pah-Wraiths. Choosing to follow Kirk’s lead, Q and the rest of the crew venture into the wormhole where they are vastly outnumbered by the Pah-Wraiths. Sisko is killed, but he manages to pass on his Prophet to Spock, who comes up with a logical solution – allow Q to become the Prophet’s next host. This gives Q omnipotence on an entirely different level, allowing him to easily defeat the Pah-Wraiths and turn Gul Dukat into a pile of dust. Using his newfound powers to transport the Enterprise back to its own place and time, Q leaves Kirk and Spock wondering if they can avert the future they saw.

Q then returns to the Prime Universe where an annoyed Ambassador Picard takes one look at the now super-omnipotent being and assures him, “I don’t want to know.” It’s a playful ending to a story that messes with time and reality on multiple levels but ultimately decides to just have fun with the idea of the new Enterprise teaming up with an alternate Deep Space Nine cast. It’s actually very enjoyable to see the characters (whose personalities are basically the same even if their lives are not) interacting with each other amid one of Q’s weird space-time games, making this a fun (if somewhat fan-fiction-type) entry into Star Trek lore.

Next: Theory: Star Trek Deep Space Nine’s Murder Mystery Solved?