The story is set in a nameless Italian city in an unspecified year (possibly sometime during the eighteenth century) and concerns the deadly revenge taken by the narrator on a friend who he claims has insulted him. Like several of Poe's stories, and in keeping with the 19th-century fascination with the subject, the narrative revolves around a person being buried alive – in this case, by immurement.
He baits Fortunato by telling him he has obtained, out of season, what he believes to be a pipe of Amontillado (about 130 gallons), a rare and valuable sherry wine. He wants his friend's expert opinion on the subject. Fortunato goes with Montresor to the wine cellars of the latter's palazzo, where they wander in the catacombs. Montresor gives Fortunato more to drink; at one point, Fortunato makes an elaborate and, to the narrator's eyes, grotesque gesture with an upraised wine bottle. When Montresor fails to recognize the gesture, Fortunato asks, "You are not of the masons?" - Montresor says he is, and when Fortunato, disbelieving, requests a sign, Montresor displays a trowel he had been hiding.
Montresor warns Fortunato, who has a bad cough, of the damp, and suggests they go back; Fortunato insists on continuing, claiming that "[he] shall not die of a cough." During their walk, Montresor mentions his family coat of arms - a golden foot crushing a snake whose fangs are embedded in the foot's heel - with the motto Nemo me impune lacessit (No one strikes me with impunity). When they come to a niche, Montresor tells his victim that the Amontillado is within. Fortunato enters and, drunk and unsuspecting, does not resist as Montresor quickly chains him to the wall. Montresor then declares that, since Fortunato won't go back, he must "positively leave [him]."
Montresor walls up the niche, entombing his friend alive. At first, Fortunato, who recovers from his drunken state faster than Montresor anticipated he would, shakes the chains, trying to escape. The narrator stops working for a while so he can enjoy the sound. Fortunato then screams for help, but Montresor mocks his cries, knowing nobody can hear them. Fortunato laughs weakly and tries to pretend that he is the subject of a joke and that people will be waiting for him (including the Lady Fortunato). As the murderer finishes the topmost row of stones, Fortunato wails "For the love of God, Montresor!" Montresor replies, "Yes, for the love of God!" He listens for a reply but hears only the jester's bells ringing as he places the last stone. He claims that he feels sick at heart, but dismisses this reaction as an effect of the dampness of the catacombs.
In the last few sentences, Montresor reveals that it has been 50 years since the murder, he has never been caught, and Fortunato's body still hangs from its chains in the niche where he left it. The murderer, seemingly unrepentant, ends the story by remarking: In pace requiescat (may he rest in peace).
Montresor's motive for murder is uncertain other than the vague "many injuries" to which he refers. Many commentators conclude that, lacking significant reason, Montresor must be insane, though even this is questionable because of the intricate details of the plot.
Though Fortunato is presented as a connoisseur of fine wine, his actions in the story make it questionable. For example, he becomes so drunk he would be unable to identify the Amontillado and treats De Grave, an expensive French wine, with very little regard by drinking it in a single gulp.
An apocryphal legend holds that the inspiration for "The Cask of Amontillado" came from a story Poe had heard at Castle Island (South Boston), Massachusetts when he was a private there in 1827. According to this legend, while stationed at Castle Island in 1827 he saw a monument to Lieutenant Robert Massie. Massie had been killed in a sword duel on Christmas day in 1817 by Lieutenant Gustavis Drane. Other soldiers took revenge on Drane by getting him drunk, luring him into the dungeon, chaining him to a wall, and sealing him in a vault. A report of a skeleton discovered on the island may be a confused remembering of Poe's major source, Joel Headley's "A Man Built in a Wall" (1844), which recounts the author's seeing an immured skeleton in the wall of a church in Italy. Headley's story includes details very similar to "The Cask of Amontillado"; in addition to walling an enemy into a hidden niche, the story details the careful placement of the bricks, the motive of revenge, and the victim's agonizing moaning. Poe may have also seen similar themes in Honoré de Balzac's "Le Grande Bretêche" (Democratic Review, November 1843) or his friend George Lippard's The Quaker City; or The Monks of Monk Hall (1845). Poe may have borrowed Montresor's family slogan Nemo me impune lacessit from James Fenimore Cooper, who used the line in The Last of the Mohicans (1826).
Poe wrote his tale, however, as a response to his personal rival Thomas Dunn English. Poe and English had several confrontations, usually centered around literary caricatures of one another. One of English's writings went a bit too far, and Poe successfully sued his editors at The New York Mirror for libel in 1846. That year English published a revenge-based novel called 1844, or, The Power of the S.F. Its plot was convoluted and difficult to follow, but made references to secret societies and ultimately had a main theme of revenge. It included a character named Marmaduke Hammerhead, the famous author of "The Black Crow", who uses phrases like "Nevermore" and "lost Lenore." This parody of Poe was depicted as a drunkard, liar, and domestic abuser. Poe responded with "The Cask of Amontillado", using very specific references to English's novel. In Poe's story, for example, Fortunato makes reference to the secret society of Masons, similar to the secret society in 1844, and even makes a gesture similar to one portrayed in 1844 (it was a signal of distress). English had also used an image of a token with a hawk grasping a snake in its claws, similar to Montresor's coat of arms bearing a foot stomping on a snake—though in this image, the snake is biting the heel. In fact, much of the scene of "The Cask of Amontillado" comes from a scene in 1844 that takes place in a subterranean vault. In the end, then, it is Poe who "punishes with impunity" by not taking credit for his own literary revenge and by crafting a concise tale (as opposed to a novel) with a singular effect, as he had suggested in his essay "The Philosophy of Composition.
Poe may have also been inspired, at least in part, by the Washingtonian movement, a fellowship that promoted temperance. The group was made up of reformed drinkers who tried to scare people into abstaining from alcohol. Poe may have made a promise to join the movement in 1843 after a bout of drinking with the hopes of gaining a political appointment. "The Cask of Amontillado" then may be a "dark temperance tale", meant to shock people into realizing the dangers of drinking.
Poe scholar Richard P. Benton has stated his belief that "Poe's protagonist is an Englished version of the French Montrésor" and has argued forcefully that Poe's model for Montresor "was Claude de Bourdeille, Count of Montrésor, the seventeenth-century political conspirator in the entourage of King Louis XIII's weak-willed brother, Gaston d'Orléans"; the "noted intriguer and memoir-writer" was first linked to The Cask of Amontillado by Poe scholar Burton R. Pollin.