Meeting Keiko upon her return from Bajor, O'Brien is shocked when his wife says, in her own voice, that she is really an entity that has taken possession of Keiko's body and is holding her hostage. She states O'Brien must reconfigure some communication and sensor relays on the station or Keiko will be killed, and sends Keiko into a convulsion to prove her point. Seeing no other alternative and assured no one will be harmed, O'Brien reluctantly agrees to the entity's demands.
Since he must pretend everything is normal, O'Brien attends the birthday party Keiko planned for him. The entity fools their friends, so no one suspects anything. The next morning, she orders him to recalibrate and sequence the impulse response filters in the subspace communication emitters. O'Brien isn't sure this complicated assignment won't hurt the station, and decides to go to Captain Sisko. As he walks toward the captain on the Promenade, he suddenly hears his wife call him, and looks up to see Keiko, her eyes filled with tears, leaning over the railing on the upper level. Before his horrified eyes, she plummets to the Promenade.
Keiko was lucky — she was left with no permanent injuries. O'Brien hurries in to see her, and winds up speaking to the entity still inside her. It warns him again to not tell Sisko, and says he has thirteen hours to complete his task. With no idea how he will finish in time by himself, O'Brien swears Rom to secrecy and puts him to work on the project. At three that morning, a worried Dax approaches O'Brien. She inadvertently discovered O'Brien's alterations and is led to the conclusion that there is a saboteur. Sisko calls an emergency meeting, where O'Brien must pretend to know nothing. Keiko interrupts the meeting and reminds O'Brien that he is running out of time. When Odo brings in Rom for questioning, O'Brien uses the opportunity to finish his work. But Rom refuses to speak to anyone but O'Brien — alone. This forces O'Brien back to Security. Rom secretly tells O'Brien he has done as he's been told and hasn't revealed anything. He only has one question. Why are they recalibrating the deflector in order to kill the aliens within the wormhole?
The question brings it all together for O'Brien. Their recalibrations will focus a beam at the wormhole that, while harmless to humanoids, will be deadly to the aliens inside it. Rom reminds O'Brien that these aliens are the Bajoran Prophets, and is told that, according to Bajoran legend, Pah-wraiths are the enemies of those Prophets. Keiko visited the mythical home of the Pah-wraiths during her trip to Bajor — and it is apparently one of them who is using her body. O'Brien finishes his job, but is confronted by the suspicious Odo. Unable to lose any more time, O'Brien knocks him out, then arranges to meet the Keiko entity in a runabout. They take off and target the center of the wormhole. Sisko orders O'Brien back, but he activates the beam. Instead of firing into the wormhole, however, the beam blasts the runabout. Keiko is hit with a massive shock and falls to the ground. However, she awakens free of the Pah-wraith. Having saved his wife, O'Brien then returns to the station ready to explain his bizarre behavior to Sisko and the crew.