[[quoteright:1000:https://static.tvtropes.org/pmwiki/pub/images/screenshot_2024_03_18_151332.png]]
[[caption-width-right:1000:Sloan's hosting a going-away party, and it's ''[[DeadlyEuphemism to die for!]]'']]

With the morphogenic plague in its final stages, Odo is dying, and Bashir builds a special hospital bed to ease his pain. Odo summons Kira to his bedside and tells her that he doesn't want her to have to witness the death of another lover, so he sends her away. She reluctantly complies with his final wish. Bashir and O'Brien finally come clean to Sisko about their last-ditch scheme to find a cure: abducting a Section 31 operative. Bashir admits that he's already put in the false report about finding a cure and has acquired illegal Romulan [[MindProbe mind probes]] to extract the real cure from the operative. Appalled that Section 31 is behind the plague, Sisko decides to turn a blind eye toward the pair's plan.

Late one night, Sloan [[TrespassingToTalk appears in Bashir's quarters]], as he's often inclined to do, claiming to have a job for Bashir, but the doctor is ready. He raises a forcefield, trapping the spy. Sloan denies knowing anything about the plague, so Bashir stuns him and brings him to his lab, where O'Brien is waiting with the mind probes. When Sloan wakes up, he proclaims that he's willing to die to save the Federation and activates a [[SuicidePill suicide implant]] in his brain. Bashir springs into action to save his life but only manages to delay the inevitable. Sloan's brain has been scrambled, and he'll die within an hour. The only way to retrieve the information is for Bashir to [[JourneyToTheCenterOfTheMind link directly with Sloan's mind]], but if he's still linked when Sloan dies, he'll die too, so he'll have to spike his blood pressure to eject himself before that happens. O'Brien insists on accompanying him in spite of the danger.

Within Sloan's mind, the pair find themselves on Deep Space Nine. Sloan greets them as friends and tries to explain the cure, but his mental conditioning prevents him. He invites them to attend a reception of his loved ones in his honor, where he receives a datapad with the cure from his wife, but before he can hand it over, another version of Sloan shoots the friendly one, who disappears. O'Brien and Bashir give chase but get injured by a guard. Now trapped in Sloan's mind, the pair discuss their friendship before seeing "[[GoIntoTheLight the light]]" of the afterlife approaching. They resolve not to give up and are about to open a nearby door when they suddenly find themselves snapped back to their lab, with Sisko, Worf and Ezri standing over them. They've escaped but failed, and Sloan dies, taking the cure with him.

Devastated, Bashir retires to his room to read Jadzia's copy of ''Literature/ATaleOfTwoCities'', but he notices that the famous opening line of the story appears in the middle of the book as the [[AGlitchInTheMatrix text starts over]]. Bashir deduces they are still inside Sloan's mind, which can only reproduce the part of the book that Bashir recalls reading. He and O'Brien realize that they need to get back to that door they almost opened. Inside, Sloan is waiting with stacks of datapads containing everything there is to know about Section 31. Bashir races to read as much as he can so he can take down Section 31 for good, but O'Brien warns him that Sloan is trying to distract him long enough to die. Reluctantly, Bashir focuses on finding the cure and wakes up, this time for real. Bashir uses the knowledge he gained to create a cure and administers it to Odo, who is instantly cured. Later, O'Brien and Bashir share a toast afterhours at Quark's and then leave to have dinner with Keiko.

----
!Tropes in this episode:
* ApologeticAttacker: A variation. Sloan does seem genuinely regretful that Odo's succumbed to the virus. But he's unwilling to help and thereby risk the cure falling into Dominion hands.
* BatmanGambit:
** Bashir counts on the fact that Section 31 won't be so crude as to blow up all of his files and will instead locate and surgically delete the cure. He also counts on the agent pulling the same TrespassingToTalk trick that Sloan always does and has a forcefield BoobyTrap waiting.
** Sloan's last-ditch effort to prevent Bashir from curing the morphogenic virus: he tempts Bashir with all of Section 31's secrets, expecting Bashir's desire to destroy the agency to overwhelm his good sense and allow Sloan to take Bashir with him as he dies. O'Brien's presence is the only thing that keeps it from working.
* BattleInTheCenterOfTheMind: Sloan is trying to keep Bashir and O'Brien from raiding his secrets within his mind.
* BigWhat: Sisko's reaction to Bashir's theory that Section 31 infected Odo with the changeling virus, followed by a FacePalm as Bashir explains ThePlan.
* BottleEpisode: It helps that everything in Sloan's mind looks like either [=DS9=] or the ''Defiant''.
* CallBack:
** Odo refers back to [[Recap/StarTrekDeepSpaceNineS03E13LifeSupport Bareil's death]].
** Bashir knows exactly how it feels to be subjected to [[Recap/StarTrekDeepSpaceNineS07E16InterArmaEnimSilentLeges Romulan mind probes]].
** Sloan's familiar TrespassingToTalk shtick is turned against him.
* ChekhovsGun: Bashir mentions reading ''A Tale of Two Cities'' early in the episode. When he returns to it later on and [[AGlitchInTheMatrix discovers the opening line midway through the book]], he realizes all is not as it seems.
* DefiantToTheEnd: Sloan refuses to willingly cede an inch of ground to Bashir even in his last seconds of life.
* EvenEvilHasLovedOnes: Deconstructed in Sloan's mind; while he does have loved ones (a wife, children, and parents), his WellIntentionedExtremist ways made their lives difficult, and Sloan knows it. His wife, Jessica, describes being married to Sloan as "a living hell".
* {{Foreshadowing}}: In the after-hours bar, O'Brien reminds Bashir that they have to focus on the cure for Odo while Julian is growling his desire to rip out Section 31 by the root. In the climax, O'Brien is the one who pulls them out of Sloan's mind when Julian would have stayed to gather the evidence he needed to bring it down.
* AFormYouAreComfortableWith: Sloan explains that he modeled the landscape of his mind to look like ''Deep Space Nine'' so that Bashir and O'Brien would be comfortable.
* AGlitchInTheMatrix: Bashir finds the novel he is reading starting over again because he never read it before and doesn't know where it goes from there.
* GoIntoTheLight: {{Defied}}--when Bashir and Julian see the Light in Sloan's mind, O'Brien refuses to simply surrender to it.
* HardWorkMontage: O'Brien setting up the gizmos to link himself and Bashir with Sloan.
* HiddenDepths: The manipulative, seemingly remorseless Sloan does harbor some regret for his actions and the effect they've had on his personal life. Bashir and O'Brien actually meet this side of Sloan while rifling around in his mind.
* HowDareYouDieOnMe: Bashir refuses to let Sloan die before revealing the cure.
* HowTheMightyHaveFallen: Downplayed, but it's revealed that Jaresh Inyo is no longer the UFP President. It's left unclear if he lost re-election or stepped down following Leyton's attempted coup.
* JourneyToTheCenterOfTheMind: A very twisted mind at that.
* LuredIntoATrap: Sloan. Even he can barely believe it.
* MindProbe: Bashir uses Romulan mind probes to scan Sloan's mind and fish out the cure for the morphogenic virus.
* TheMole: Section 31 is revealed to have had a mole in former UFP President Jaresh Inyo's Cabinet.
* MoralMyopia: Sloan points out that the use of Romulan mind probes is illegal in the Federation.
-->'''Bashir''': Oh... I hope you can appreciate the irony of ''that'' statement.
* NervesOfSteel: In spite of obviously being rattled that Bashir has him at his mercy, Sloan regains his composure and generally remains calm and snarky right up until he commits suicide.
* OhCrap: Sloan's typically unflappable nature starts to crack when he becomes trapped in Bashir's forcefield. He really understands what trouble he's in when Bashir states his intention to use Romulan mind probes to find the cure.
* TheOner: One of the longest shots in all of ''Star Trek''; when Bashir and O'Brien are trapped in Sloan's mind and believe themselves doomed, they have a conversation about how much they "like" each other; this entire conversation is held in one shot that runs just shy of three minutes in length.
* OtherMeAnnoysMe: A bizarre variation: just as Sloan is about to give Bashir the cure for Odo -- the part of himself who is repentant for the horrors he did, for the things he had to sacrifice in what he now sees as a wasted life-- another Sloan, the unfettered part of himself, shoots him.
* OutGambitted: Sloan finally gets out-played when Bashir lures him to [=DS9=] with a fake story and captures him. To his credit, Sloan still comes close to wrecking Bashir's plans and dragging the doctor with him into death.
* PercussiveTherapy: Julian sneaks into the bar after-hours to throw darts ''really'' hard.
* ShameIfSomethingHappened: Sloan tries to pull this regarding O'Brien's family, but Bashir tells him to shut up.
-->'''Sloan:''' Hello, Chief. How's the family? Everyone okay at home?\\
'''O'Brien:''' What's that supposed to mean?\\
'''Sloan:''' Nothing. I'd just hate to see anything happen to them.\\
'''Bashir:''' Don't listen to him, Chief. He's just playing games with you.\\
'''Sloan:''' That's easy for him to say. He doesn't have a wife and children to worry about. Trust me, Chief, if something were to happen to me--\\
'''Bashir:''' What? They'll be killed? I'm disappointed in you, Sloan. You don't usually wield such a blunt instrument.
* SnipeHunt: Sloan appears with another mission for Bashir, designed to get him off the station while Sloan finds the cure. [[{{Defied}} Bashir has other ideas.]]
* SignatureStyle: A plot point. Bashir's had enough experience dealing with Sloan by now to know what to expect. This is not only how Bashir's able to capture Sloan after his customary midnight 'drop in', but to also correctly deduce Sloan possesses the data on the cure. After all, Sloan is clever and likes employing surgical precision in his work. He would ''never'' blow up Bashir's entire lab just to destroy the cure when destroying the cure itself would be enough. As Bashir reasons, this means Sloan knows what to look for and thus knows how to synthesize the cure.
* StealthPun: The part of Sloan's mind that refuses to give up the cure looks like the ''Defiant''.
* SuicidePill: Sloan has a neural implant that can allow him to commit suicide upon capture, just like the Vorta.
* TakingYouWithMe: Sloan attempts this on Bashir and O'Brien. Fortunately, ThePowerOfFriendship wins out.
* TechnoBabble: [[TheEngineer O'Brien]] of all people is confused by Bashir's explanation of the neural engrammatic link.
* ThisIsGonnaSuck: A variation--when Bashir tells Sisko that his plan involves using illegal Romulan mind probes on Sloan, the look on Sisko's face and his little "Oh" both say, "This is gonna be one of ''those'' plans."
* TranquilFury: Sisko's reaction upon learning the true origin of the Morphogenic Virus (and that Federation citizens have committed an act of genocide).
* TrespassingToTalk: Sloan does this to Bashir--[[BatmanGambit just like Bashir was expecting]].
* UnderestimatingBadassery: Sloan is genuinely lost for a backup plan when it becomes clear that Bashir intends to mind-probe him. He tries an appeal to Bashir's humanity, saying he is sorry Odo has to die, but revealing the cure could endanger billions of lives. Bashir says that might be a persuasive argument, ''if'' Sloan had a vote - which he doesn't.
* {{Unperson}}: The good part of Sloan remarks that he is a version of this. Having wiped away all traces of his life beforehand, leaving no footprints to follow, he won't be missed because he isn't even remembered.
* WhateverHappenedToTheMouse: Jaresh Inyo's fate following mid-Season Four is finally revealed. He's no longer the UFP President, but it's left unclear if he resigned following Leyton's attempted coup or lost re-election.
* XenoNucleicAcid: The cure for the Changeling virus uses adenine, radodine, lidestolinine, and asporanine.
* YourMindMakesItReal: Getting shot in Sloan's mind makes Bashir and O'Brien feel like they've really been shot.