The Duke enters, disguised as a friar, and Escalus begins to question him instead. Escalus asks him if he sent Isabella and Mariana to slander Angelo, claiming that they have already accused him of doing so. The Duke says this is untrue and asks to see the Duke. Escalus says that the Duke has given him free reign. Escalus threatens to torture the Duke's friar alter ego, who says that he has seen a lot of corruption during his visit to Vienna.
Angelo asks Lucio to testify against the Duke/Friar, and he claims that he heard the Duke/Friar slander the Duke. The Duke argues that it was actually Lucio who insulted the Duke, saying that he loves the Duke as much as he loves himself. Escalus tries to send the Duke off to prison, but the Duke tells the provost not to obey. Lucio pulls the Duke's hood off, revealing his identity.
The Duke turns to Angelo and asks if there is anything he would like to say in his own defense. Angelo confesses to his crime and asks for a death sentence. The Duke sentences him to marry Mariana instead. The Duke asks Isabella to come to him, and she says that she is ashamed to have asked him for help. He supposes that she must be wondering why he did not disclose his identity earlier in order to save Claudio's life, and he tells her that the death occurred sooner than he expected, but that Claudio was now in a better place. On Isabella's behalf, the Duke orders Angelo to be executed to pay for Claudio's death.
Mariana says, "I hope you will not mock me with a husband!" (V.i.420). She is worried that she will be a widow instead of a married woman, and so she asks for her husband to be pardoned. The Duke refuses, saying that at least her virtue will be preserved, and that she can find a better husband now. Mariana asks for Isabella's help in persuading the Duke, saying that everyone has their faults.
Isabella kneels and asks the Duke to pardon Angelo, saying that she believes he meant well in his original plans to clean up the city. The Duke is distracted by another question and asks the provost why Claudio was executed at such an unusual hour. He fires the provost for obeying private orders. The provost argues that he went against private orders by saving Barnadine, and the Duke asks to see him.
The provost brings Barnadine, along with a muffled Claudio. The Duke pardons Barnadine, telling the friar to take care of him. He then asks who the muffled man is. The provost says he is another prisoner meant to be executed, one that looks like Claudio. He unveils Claudio. The Duke tells Isabella that Claudio is pardoned and asks her to marry him. He then sentences Lucio to marry whatever woman claims to have been impregnated by him. The Duke concludes by saying that everyone should live happily ever after, including Isabella and himself.