The Enterprise visits Velara III, a terraforming station with which communications have been erratic. After doing everything short of ordering them not to beam down, the Director, Kurt Mandl, allows them down and warmly welcomes them. Shortly after they arrive, however, one of the engineers, Arthur Malencon, is killed while using the laser-drill.

All but Geordi, Data, and engineer Bjorn Benson (one of the three terraformers remaining) beam up. Data discovers that the laser firing was not a malfunction, but seemed to act with a will. He restarts it, and it immediately attempts to kill him, but is destroyed. As suspicion begins to fall on the other terraformers, Data and Geordi discover what may well be inorganic life!

They beam the sample aboard and keep it in a medical lab, where they find that, although it is certainly inorganic, it is almost certainly alive. The terraformers claim not to know anything about this lifeform, but the two men are unconvincing. The lifeform reproduces, then manages to shrug off the quarantine field, and then tries to communicate with the ship, proving itself to be not only life, but intelligent life.

Picard discovers that Benson and Mandl occasionally saw strange patterns in the sand down on Velara, which were ignored, but were clearly in hindsight attempts to communicate. The lifeform, which contains all the necessary elements to be a living computer, divides again and again, until it becomes formidable. Angry over nearly being killed by the terraformers, it declares war on the Enterprise.

They try to beam it back, with no success, and then the lifeform gains control over the Enterprise computer. Realizing that the creature is photosensitive, Riker kills the lights in the lab, rendering it helpless. It begs for mercy, and the Enterprise beams it home and declares Velara III off-limits.