An unnamed narrator opens the story by revealing that he has been sentenced to death during the time of the Inquisition—an institution of the Catholic government in fifteenth- and sixteenth-century Spain that persecuted all Protestants and heretical Catholics. Upon receiving his death sentence, the narrator swoons, losing consciousness. When he wakes, he faces complete darkness. He is confused because he knows that the usual fate of Inquisition victims is a public auto-da-fé, or “act of faith”—an execution normally taking the form of a hanging. He is afraid that he has been locked in a tomb, but he gets up and walks a few paces. This mobility then leads him to surmise that he is not in a tomb, but perhaps in one of the dungeons at Toledo, an infamous Inquisition prison. He decides to explore. Ripping off a piece of the hem from his robe, he places it against the wall so that he can count the number of steps required to walk the perimeter of the cell. However, he soon stumbles and collapses to the ground, where he falls asleep.

Upon waking, the narrator finds offerings of water and bread, which he eagerly consumes. He then resumes his exploration of the prison, determining it to be roughly one hundred paces around. He decides to walk across the room. As he crosses, though, the hem that he ripped earlier tangles around his feet and trips him. Hitting the floor, he realizes that, although most of his body has fallen on solid ground, his face dangles over an abyss. To his dismay, he concludes that in the center of the prison there exists a circular pit. To estimate its depth, the narrator breaks a stone off the wall of the pit and throws it in, timing its descent. The pit, he believes, is quite deep, with water at the bottom. Reflecting upon his proximity to the pit, the narrator explains its function as a punishment of surprise, infamously popular with the Inquisitors. The narrator falls asleep again and wakes up to more water and bread. After drinking, he immediately falls asleep again and imagines that the water must have been drugged. When he wakes up the next time, he finds the prison dimly lit. He remarks that he has overestimated its size, most likely having duplicated his steps during his explorations.

The narrator discovers that he is now bound to a wooden board by a long strap wrapped around his body. His captors offer him some flavorful meat in a dish, but no more water. When he looks up, he notices that the figure of Time has been painted on the ceiling. Time, however, has been made into a machine, specifically a pendulum, which appears to be swinging back and forth. The narrator looks away from the ceiling, though, when he notices rats coming out of the pit and swarming around his food. When he returns his focus to the ceiling, he discovers that the pendulum is constructed like a scythe and is making a razor-sharp crescent in its descent toward him. Its progress, however, is maddeningly slow and in a trajectory directly over his heart. Even though he recognizes how dire the situation is, the narrator remains hopeful. When the pendulum gets very close to him, he has a flash of insight. He rubs the food from his plate all over the strap that is restraining his mobility. Drawn by the food, the rats climb on top of the narrator and chew through the strap. As the pendulum nears his heart, the narrator breaks through the strap and escapes from the pendulum’s swing. When he gets up, the pendulum retracts to the ceiling, and he concludes that people must be watching his every move.

The walls of the prison then heat up and begin moving in toward the pit. The narrator realizes that the enclosing walls will force him into the pit, an escape that will also mean his death. When there remains not even an inch foothold for the narrator, the walls suddenly retract and cool down. In his fear, however, the narrator has begun to faint into the pit. To his great surprise, though, a mysterious person latches onto him and prevents his fall. The French general Lasalle and his army have successfully taken over the prison in their effort to terminate the Inquisition.