"Chain of Command" is an episode of Star Trek: The Next Generation that aired in two parts during the sixth season of the series. It was developed to establish the Cardassians as the main villains of the then-forthcoming Star Trek: Deep Space Nine.
The episode's second part, which dealt with Picard's torture at the hands of the Cardassians, was the second episode in the series' history to earn a parental advisory disclaimer.
Captain Picard, Lt. Worf, and Dr. Crusher are assigned by Starfleet on an undercover mission to destroy a Cardassian biological weapons installation on Celtris III, a Cardassian border world. In Picard's place, Starfleet assigns Captain Edward Jellico (played by Ronny Cox), who exhibits a vastly different style of command and decorum on the Enterprise crew, particularly to Commander Riker. Under Jellico's command, the Enterprise patrols the border near Minos Korva, a tactically-significant Federation planet, and holds negotiations as to the fate of the planet with Cardassian representatives.
After training in the holodeck, Picard, Worf, and Crusher discretely arrive on Celtris III and infiltrate the installation. They find no signs of biological weapons, and soon discover their information was a Cardassian trap. Worf and Crusher escape, but Picard is captured and taken to an interrogator, Gul Madred (David Warner). Madred uses a number of torture methods, including sensory deprivation, sensory bombardment, forced nakedness, stress positions, dehydration, starvation, physical pain, and cultural humiliation to try to gain knowledge of the Federation's plans for Minos Korva. Picard refuses to acknowledge Madred's demand for information. Madred attempts another tactic to break Picard's will: he shows his captive four bright lights, and demands that Picard answer that there are five, inflicting intense pain on Picard if he does not answer in that fashion.
Meanwhile, the Cardassians inform the Enterprise crew that Picard has been captured. Jellico refuses to acknowledge that Picard was on a Starfleet mission; this leads to a heated argument between Jellico and Riker upon which Jellico strips Riker of his command. The crew observes signs of residue from a nearby nebula, and Jellico suspects a Cardassian fleet may attempt to use the cover of the nebula to launch an attack on Minos Korva. Jellico determines their best course of action is to mine the nebula using a shuttlecraft, but would require the skilled piloting controls that only Riker possesses. Riker candidly discusses Jellico's command style with the officer, and only accepts the assignment once Jellico personally asks him to pilot the shuttle instead of commanding it, a contrast to Jellico's style. Riker successfully lays the minefield, and Jellico uses the threat of the minefield to force the Cardassians to disarm and retreat, also demanding Picard's return.
With word of the failure of the Cardassians to secure Minos Korva, Madred attempts one last ploy to break Picard, to claim that Cardassia has taken the planet and the Enterprise was destroyed in the battle. He offers Picard a choice; to remain in captivity for the rest of his life, or live in relative comfort on Cardassia by admitting he sees five lights. As Picard momentarily considers the offer, a Cardassian officer interrupts the process and informs Madred that Picard must be returned now. As Picard is freed from his bonds and taken away, he turns back to Madred and defiantly shouts "there are four lights!" Picard is returned to the Federation and reinstated as Captain of the Enterprise. Picard admits privately to Counsilor Troi that while he was willing to tell Madred anything, he was more concerned that, for a moment, he thought he had seen five lights.
Madred's test using four lights was found to be a homage to George Orwell's Nineteen Eighty-Four, in which O'Brien tortures Winston Smith by making him admit that he sees five fingers when he only holds up four.