The Federation starship Enterprise arrives at the planet Bre'el IV, whose moon is descending from its orbit and threatening to crash into the highly populated world below.
He explains that he has come to the Enterprise seeking asylum, as he has been stripped of his powers and banished from his home dimension, the Q Continuum, as punishment for his chaotic antics.
Q is attacked by the Calamarain, a gaseous alien species he once tormented; and Picard deduces that Q sought refuge on the Enterprise to protect himself from the countless creatures he has mistreated.
When the Enterprise's shields are lowered for a test of Geordi’s procedure, the Calamarain attack again, and Data is nearly electrocuted defending Q from their assault.
Realizing that his presence on the Enterprise is causing more harm than good, Q leaves the ship in a shuttlecraft, intending to sacrifice himself to draw the Calamarain away.
As the Calamarain close in on the shuttle, a second Q being appears and informs Q that due to his selfless act, the Continuum is willing to restore his powers.
On learning that the Bre'el moon has been safely returned to orbit, Picard surmises that Q was responsible and muses that the omnipotent being may have a residue of humanity after all.
[2] In 2019, Mike Bloom writing for The Hollywood Reporter listed "Deja Q" among the twenty five best episodes of the series.
[4] In 2019, Screen Rant ranked "Déjà Q" one of the top ten episodes of Star Trek: The Next Generation, describing it as funny, noting how Q must "reconcile with his newfound mortality", and that it wraps up with a heart-warming ending.