While en route to investigate Farpoint station, a remote starbase on planet Deneb IV, whose origins are somewhat mysterious, the Enterprise is trapped by an entity which calls itself ``Q'', and warns them to go back to where they came from. Q condemns humanity as ``a dangerous savage child-race.'' When Picard says that Q, like so many others, is too eager to prosecute and judge, Q reacts with glee and vanishes.

Picard orders the Enterprise to try to outrun the force-field in front of them. When that fails, he separates the saucer, putting Worf in command of it, and surrenders. Q then puts Picard, Troi, Yar, and Data in a 21st-century court, with himself as judge.

Picard is forced to admit that ``there is evidence to support the court's contention that humans have been savage!'', but suggests that Q use the Enterprise to test whether this is presently true of humans. Q agrees, and says that Farpoint will prove an excellent test.

Meanwhile, Commander Riker is on Farpoint. He meets with the Bandi leader, Groppler Zorn, and notices some odd wish-fulfillment effects, both in Zorn's office, and later, with Dr. Crusher and Wesley. After we find out that Picard brought home Wesley's father's body to him years ago, Geordi La Forge arrives and tells Riker that the Enterprise is in orbit, without the saucer, and that he should beam up immediately.

Riker does so, is brought up to date on what's happened with Q. As the saucer arrives, Picard orders Riker to conduct a manual docking with uncharacteristic gruffness. After Riker does this successfully, Picard and Riker talk, and we learn that Riker has in the past refused to let his captain beam down. He refuses to back down from this position, and Picard formally welcomes him.

After being accosted by Q again, who gives them 24 hours more to solve the mystery, Riker, Picard, and Troi meet with Zorn, who refuses to answer their questions. Even when Troi senses unbelievable pain and loneliness nearby, Zorn refuses to say what's going on, and threatens a Ferengi alliance.

Riker later meets Data on the holodeck before taking him on an away team, and though puzzled by him, quickly befriends the android. They meet Wesley, who chooses just the wrong moment to fall into the lake, as he meets Picard shortly afterward. Riker takes down his away team, which splits into two groups: Riker and Data investigate the surface of the station, and Geordi, Yar, and Troi investigate the tunnels below it. Troi again senses pain, even stronger this time, and the teams reunite.

While Beverly reports to Picard, Picard invites Wes to sit in his chair for a few moments. Wes shows an uncanny knowledge of starship operations, but succeeds only in angering Picard and being ordered off the bridge, just as an unidentified vessel approaches. It scans the Enterprise, and then fires on the old Bandi city that's next to Farpoint. Yar, Troi and Geordi beam up, as Riker and Data go exploring on the outskirts of that same city.

Picard, left with what he sees as no other choice, orders that phasers be locked on the other ship. As he does so, Q appears and gloats. Picard, refusing to fire, then tries to move the Enterprise between the city and the ship, but finds that Q has locked the controls. He orders Riker and Data to kidnap Zorn and bring him aboard for some answers, but a different transporter beam takes Zorn away just as they arrive at his office.

Riker, at Q's urging, takes an away party over to the other ship, where they find Zorn and free him. Troi then realizes that she's only sensing one alien presence-the ship itself is alive! Picard finishes piecing together the puzzle, reasoning that both the ship and Farpoint station are alive, and that the Bandi captured Farpoint station, feeding it only enough to keep it alive. They rig an energy beam and deliver Farpoint enough energy to free itself, and it rejoins its mate. Passing Q's test, Picard orders Q off the ship. Q leaves, but not without hinting that he will return again. The Enterprise heads out into the unknown.