Returning from a mission to the Gamma Quadrant on the other side of the wormhole, Lieutenant Dax and an ensign are trapped in their Runabout. While O'Brien works to free them, Dr. Bashir sees there are actually three people inside the scout ship. When they get the hatch open, O'Brien recognizes the third occupant as Vash, a woman he met while serving on the Enterprise. He and Sisko wonder how she got to that distant part of the galaxy two years ago. Their answer, unknown to them, stands nearby — the mysterious Q.
Suspicious, Sisko tries to learn more about Vash and her claims to be an archeologist. Meanwhile, Vash, now back in Federation territory, makes plans to leave the station. She locks away her valuable artifacts from the Gamma Quadrant, including a beautiful geode that glows with a pulsating internal light. Sisko questions Vash about how she arrived there without going through the wormhole, but she keeps the matter to herself. She also learns from him that Earth's Daystrom Institute is interested in her adventures, which could mean free passage back home. O'Brien reveals to Sisko that Vash and the Enterprise's Captain Picard were once very close friends, but their discussion is interrupted by a sudden and brief loss of power throughout the station. Dax points out that a similar phenomenon happened when she was on the runabout Ganges. Suspicions increase.
Later, Q pops in on Vash in her quarters, attempting to revive the partnership they once had. Vash, however, is uninterested. She is then visited by Quark, who has learned of her prized treasures and smells profit in the air. They form an agreement to hold an auction at the station for her artifacts, from which Quark will get a small percentage. Meanwhile, Bashir, infatuated with Vash, stops by to invite her to dinner. She agrees. But Q interferes with the date by making Bashir too tired to meet her.
These minor mysteries begin to make sense when O'Brien recognizes Q from the Enterprise. He immediately warns Sisko and the other officers about the alien prankster, and when the station experiences a major drop in the main power grid, O'Brien attributes it to one of Q's jokes. Sisko is not amused.
Meanwhile, Quark haggles with Vash over the price of her geode. He senses great value for himself from the artifact, but Vash isn't about to sell it to him for next to nothing. Sisko then arrives to speak with Vash in private, but Q appears and confronts the commander. True to his character, Q places himself and Sisko in a circa 1900 boxing ring, but is surprised when Sisko actually punches him in the face. The setting reverts to normal, and Vash asks Sisko to help her be rid of Q. Sisko isn't sure what he can do.
The next day, the station experiences another great loss of power, but this time the officers notice that these episodes are facilitating a series of hull fractures. Sisko reconsiders whether or not Q is really responsible for this. At this rate, station life support will fail in fourteen hours. Sisko and the rest of the officers decide to flood the station with a small amount of tridium gas in order to trace the source of the power drain.
Q persists in pestering Vash to rejoin him on his travels. She still refuses, and he briefly forces her to experience some of the ghastly things that could happen to her in the galaxy without his protection. Q then appears with Sisko and his fellow officers, taunting them to find a solution to their predicament, and mentions to Sisko that maybe Vash is more dangerous to the station than they realize.
Later, Quark holds an auction at his bar, but it is interrupted by a violent shaking. Apparently, the station's graviton field has increased, and it is being pulled toward the wormhole by an unknown force — one that's not Q or the wormhole itself. Quark's auction continues even though Q warns the crowd that the space station itself may be destroyed any minute.
Dax suggests bringing the reactors back on line to render the power drain large enough to trace. They then determine that the drain is originating from Quark's bar. Sisko, Kira, and Dax rush to the bar, and find that Vash's glowing geode is what's causing the drain. O'Brien transports the artifact off the station just before it explodes in a brilliant flash of light, from which emerges a winged energy creature that soars into the distance.
With everything returned to normal, Vash prepares to return to Earth. She and Q exchange goodbyes, both acknowledging that they will miss each other. After that, as always, Q disappears — and who knows when he'll return? Vash, on the other hand, decides on impulse to instead explore a new archeological site, and strikes up a partnership with — Quark!