“The Adversary” is episode twenty-six of season three of Star Trek: Deep Space Nine and the season finale.
Commander Sisko has just been promoted to captain and, at the celebratory party, a Federation Ambassador tells him that there’s been a recent coup in the neighbouring Tzenkethi Coalition. To show the new government that the Federation is going to protect their nearby colonies, the ambassador wants Captain Sisko to take the Defiant out to show the flag along the border.
On the journey, the Defiant receives a transmission from a colony on the border which appears to be under attack by the Tzenkethi. Unable to contact either Starfleet nor the nearest ship, the Defiant continues.
An investigation into the problem with the communications reveals that it, and many other systems on board the ship, have been sabotaged. The Federation ambassador is actually a Changeling, and he takes control of the Defiant in order to use it to start a war between the Federation and the Tzenkethi.
As the Defiant continues on its journey, Sisko and his crew struggle to catch the Changeling and regain control of the ship. Failing that, he will destroy it before allowing it to attack the Tzenkethi.