The duke, Vincentio, deputizing Angelo to act in his place, leaves Vienna, purportedly to make a journey but in fact to disguise himself as a friar and return to Vienna to watch events transpire. Moral corruption is general in the city where the duke has been lax in enforcing laws governing such matters. Angelo, eager to make the hand of justice felt, arrests Claudio, a young gentleman who has gotten his beloved Juliet with child. He sentences him to death, although Escalus, an aged advisor of the duke, urges leniency.
Lucio, a man who keeps company with pimps, bawds, and whores, learns of Claudio's plight from Mistress Overdone, whose whorehouse also falls to Angelo's zeal. Lucio informs Claudio's sister Isabella of his arrest. A religious novice on the verge of entering the sisterhood, she pleads with Angelo to spare her brother. Angelo is at first adamant, but finding himself tempted by Isabella's beauty, and by her very purity, he offers to pardon Claudio if she will yield her body to him. Isabella refuses and tells her brother that he must prepare himself for death. When he pleads with her to meet Angelo's demands, she is outraged.
The duke, disguised as a friar, now takes control of the action. Having reassured Claudio by bringing him to a sense of peace in death, he presents Isabella with a plan which will save both her virtue and her brother's life. Mariana, betrothed to Angelo and forsaken by him, will take Isabella's place in his bed. Isabella agrees and Mariana is met and gives her consent as well. The sexual encounter between Mariana and Angelo takes place in darkness and silence. Although unaware of the substitution, Angelo (in violation of his agreement with Isabella) orders that Claudio's execution proceed. The duke learns of his intention and arranges to have the head of another prisoner sent to Angelo in place of Claudio's.
Comic action is provided by the play's ribald minor characters, one of whom (Pompey) is made assistant to the executioner, Abhorson. Lucio's gossip about the duke, related unwittingly to the duke himself, is another source of humor.
A final confrontation between Isabella and Angelo is staged by the duke, and Isabella accuses Angelo of his crime, which he denies. The truth is exposed after some suspense in which the duke (returned to his true identity) pretends to believe Angelo instead of Isabella. The duke orders Angelo to wed Mariana and then sentences him to death. Begged by Mariana to plead for his life, Isabella at last consents. Angelo is pardoned by the duke, who now reveals that Claudio is still alive. Having ordered marriages between Claudio and Juliet, and Lucio and his whore, the duke himself proposes marriage to Isabella.