During a party celebrating Sisko's promotion to Captain, Admiral Krajensky takes him aside and quietly reveals that there has been a coup on the Tzenkethi homeworld that could threaten Federation colonists. Sisko and his crew are to take the Defiant and Krajensky to this sector. Soon after departing, they receive a distress signal from a colonist indicating that Barisa Prime is under attack from the Tzenkethi. The signal then goes dead — the colony has apparently been destroyed.
The crew sets course for Barisa Prime, but when Sisko tries to notify Starfleet Command, power fluctuations in the ship's communications circuitry prevent it. O'Brien and Dax go to work on the problem, and discover strange alien devices attached to almost every critical system throughout the ship. They determine that there is a saboteur aboard. Dax scans each member of the crew, and when she gets to Krajensky, he suddenly morphs into a Changeling and escapes.
The Changeling takes control of the Defiant, activating the cloaking device and arming the ship's weaponry. Sisko realizes that the visit from Krajensky, the coup, and the transmission from Barisa Prime were all faked — the Dominion is hoping to start a war between the Federation and the Tzenkethi. With the Defiant primed for battle and within seven hours of the Tzenkethi border, this looks likely if the Changeling is not located and stopped. Later, Dax is found unconscious in the engine room, forcing O'Brien to try to regain control of the ship without her. Realizing the gravity of the situation, Sisko decides that if this cannot be accomplished before they cross the border, he will be forced to destroy the Defiant.
Since the Changeling can take the form of any crew member, the officers are paired off for the search. Later, Sisko, Odo, Kira, a Bolian officer, and Eddington are separated from their partners, and each is suspicious that another is the Changeling. Odo remarks that the bleeding Sisko cannot be, because his blood would have reverted to a gelatinous state when leaving the body. Bashir draws blood from everyone, and when Eddington's seems to morph into orange goo, he is taken into custody. However, another Bashir is found, revealing that the duplicate is the Changeling. He escapes again as the ship enters Tzenkethi space.
With twelve minutes left before the ship's attack program will activate, Sisko initiates the auto-destruct sequence. O'Brien begins a last-ditch effort to access the sabotaged systems when two Odos appear. The Changeling then assumes his true form and attacks. During their fight, he takes a fatal fall into the warp core. But before dying, he whispers something to Odo. Regaining control of the Defiant, Sisko cancels the auto-destruct program. But the crisis isn't over. Odo later reveals to Sisko the Changeling's last words: "You're too late. We're everywhere."