This last act, which consists of only a single scene, takes place on a street in front of Olivia's house. Feste is reluctantly carrying Malvolio's letter to Olivia (pleading Malvolio's sanity), but Fabian is trying to discourage him from reading it. Feste, needless to say, is in no great hurry to deliver it.
Duke Orsino, Cesario (Viola), Curio, and others enter, and Orsino has a few words with Feste; he is pleased with Feste's quick wit and gives him a gold coin and tells him to announce to Olivia that he is here to speak with her and, furthermore, to "bring her along"; if he does, there may be more gold coins for Feste.
Cesario (Viola) sees Antonio approaching with several officers and tells Orsino that this is the man who rescued him from Sir Andrew earlier. (Antonio, of course, is still under arrest). Orsino remembers Antonio well; when he last saw Antonio, the sea captain's face was "besmeared / As black as Vulcan in the smoke of war." Antonio was the captain of a pirate ship then and did great damage to Orsino's fleet. Yet despite their past differences, Orsino remembers Antonio as being a brave and honorable opponent.
When he is asked to explain how he happened to be in Illyria, Antonio explains to Orsino that he is the victim of "witchcraft" — that is, he saved Cesario's life, and then this "most ingrateful boy" would not return the purse of money which he lent him earlier.
At this instant, Olivia makes a grand entrance with her attendants. When Orsino sees Olivia entering, he says that "heaven walks on earth." He tells himself that "this youth" (Cesario) "hash tended" him for three months; Antonio's words, of course, are impossible.
Olivia's ire is rankled. She asks Orsino what he wants — other than what he can't have — and she accuses Cesario of breaking an appointment with her. Frustrated to the point of madness himself, Orsino turns on Cesario: it is all his fault that Olivia has rejected him, and he will have his revenge. He knows that Olivia loves Cesario, and he is ready to "tear out [Cesario from Olivia's] cruel eye" for bestowing all her loving glances at Cesario. He orders Cesario to come with him for his "thoughts are ripe in mischief." Even though he values Cesario very much, yet he will "sacrifice the lamb . . . to spite a raven's heart." Olivia is appalled: where is the haughty Orsino taking her new husband? Cesario replies that he goes with Orsino willingly; he would, for Orsino, "a thousand deaths die." He says that he loves Orsino "more than I love these eyes, more than my life . . . [and] all the more, than e'er I shall love wife."
Olivia is thunderstruck: "Me, detested! how am I beguiled!" She calls for the priest who married her to Cesario (in fact, to Sebastian), and the priest enters and attests to the fact that a marriage did indeed take place between these two young people.
Now it is Orsino who is furious. This "proxy," this young messenger whom he hired to carry letters of love to Olivia, hoodwinked him and married Olivia himself. He turns to this "dissembling cub" and tells him to "take her; but direct thy feet / Where thou and I henceforth may never meet." Cesario (Viola) attempts to protest, but Olivia hushes him: "Oh, do not fear . . . thou hast too much fear."
Suddenly, Sir Andrew enters, crying loudly for a surgeon; Sir Toby also needs one. They say that they have been wounded by Cesario (Sebastian), and Sir Andrew's head is broken and Sir Toby has a "bloody coxcomb." They point their finger to Cesario (Viola): "Here he is!" Cesario (Viola) protests once more. He has hurt no one; yet it is true that Sir Andrew drew his sword and challenged him once to a duel, but certainly Cesario (Viola) never harmed Sir Andrew.
It seems that the surgeon is drunk and cannot come, and although Olivia tries to find out who is responsible for this bloody business, she cannot, for confusion reigns as Sir Toby and Sir Andrew help one another off to bed.
The key to the solution of all of this confusion now enters: it is Sebastian. He apologizes to Olivia for having injured Sir Toby. Orsino is the first to express astonishment at the identical appearance of Sebastian and Cesario. It is almost impossible to distinguish between them, except by the colors of their clothes. Sebastian then reminds Olivia of the words which they exchanged only a short time ago, and he calls her his "sweet one." He joyfully recognizes Antonio and confesses how "the hours [have] racked and tortured" him since he lost him. Like Orsino, Antonio is amazed. He compares Cesario and Sebastian to "an apple, cleft in two." Viola (Cesario) begins to speak then; she tells Sebastian that he is very much like a twin brother who she fears perished in a "watery tomb." Her father was Sebastian; he had a mole on one brow — and at this point, Sebastian interrupts her: so did his father. Moreover, both agree that this man died when they were thirteen years old.
Viola then reveals that her real identity is hidden by "masculine usurp'd attire"; she is Sebastian's lost twin sister, and she can prove it by taking them to the home of a sea captain who knows of her disguise and is keeping her women's clothes for her; however, they must produce Malvolio because he has been holding the sea captain imprisoned.
Sebastian turns to Olivia and tells her that she has been "mistook." Had she married Cesario (Viola), she would "have been contracted to a maid." But he gives her good news also. As her husband, he is a bit of a "maid" himself — that is, he is a virgin ("both maid and man"). Olivia calls immediately for Malvolio; she wants to hear why he has had this sea captain imprisoned, and she asks that he be specifically brought before her, even though "they say, poor gentleman, he's much distract."
At this point, Feste enters with Malvolio's letter, written as proof of his sanity. Olivia tells him to read it aloud, and he does, in an affected voice that makes everyone laugh. Olivia then gives the letter to Fabian to read. She is not truly convinced that Malvolio is all that mad. When he enters, he brings Maria's "love note" with him. Olivia instantly recognizes the handwriting as being Maria's. Thus she begins to reconstruct the intricacies of the practical joke that her servants have played on Malvolio. She declares that Malvolio shall be both plaintiff and judge of his own case against the pranksters.
Recounting all of the secret plottings which have taken place, Fabian confesses his and Sir Toby's roles in their attempt to take revenge on Malvolio. He also confesses that it was Sir Toby who persuaded Maria to write the forged love note, and that, "in recompense," he has married her. Olivia expresses pity for Malvolio; he has been "most notoriously abused," and then in lines of stately blank verse, Count Orsino ends the play by turning to Viola and telling her that while she seemed very dear to him once as a man, she is now his "mistress and fancy queen." Everyone exits, and Feste is left onstage.
He sings one last song, one of the most philosophical jester's songs in all of Shakespeare's plays. It tells of the development of men, focusing on the various stages of their lives, and putting all of the serious matters of the life of men into the dramatic context of this comedy — whose purpose is, after all, only to "please."
Unlike the earlier acts, which were divided into several individual scenes, this final act has only one scene, which gives a heightened sense of unity because most of the diverse plots, themes, complications, and mistaken identities must be unraveled and resolved. However, there are a few minor details that are left unresolved. For example, Antonio had earlier feared that he would be arrested, and we are never to know why. In this scene, Antonio is also accused of being a pirate and a sea thief and also as someone who attacked Duke Orsino's fleet, causing great damage; yet Antonio denies he was ever a thief or a pirate, and even those accusing him (Orsino, for example) admit that he has always conducted himself in honorable and heroic fashion. Whatever the cause of the conflict between Antonio and Orsino, it is left unclear. Likewise, why Malvolio has Viola's sea captain imprisoned and awaiting trial is a total mystery; this is a matter which is also left unresolved.
The first interchange of wit in the first part of the act between Duke Orsino and Feste the Clown introduces the first resolution of the various complications in the play; Feste is on his way to Olivia with a letter from Malvolio which will clear up the plot concerning the gulling and "imprisoning" of Malvolio. With the entrance of the arrested Antonio, however, confusion mounts to a higher crescendo as Cesario (Viola) is first accused of bewitching and then betraying Antonio; then there is an accusation made of his alienating Olivia's affections from Orsino; and third, Cesario (Viola) is accused of betraying the bond of marriage entered into with Olivia and attested to by the priest.
Cesario (Viola) is left speechless, of course, when these accusations are made. Antonio's charge is denied by Orsino; he knows for a fact that Cesario has been in his service for three months (events have transpired so fast that Shakespeare realized that his audience might not be aware that three months have really elapsed; thus he has Orsino point out the fact here).
The priest's testimony discredits Cesario's relationship with Orsino; thus Orsino threatens to play the role of the tyrant; that is, he will punish Olivia by putting her love, Cesario, to death — in spite of his own strong attraction to the youth. The sudden appearance of Sir Andrew, followed by Sir Toby, creates another diversion. They enter wounded, calling loudly for a "surgeon," and accuse Cesario of having beaten them violently; clearly, we can see that they have indeed been beaten by someone. But the description of their assailant as a very fierce devil scarcely fits our knowledge of the character of the gentle young Cesario (Viola), even though their bleeding heads confirm a beating.
When Sebastian enters, the final solution of the puzzle is now at hand. The most striking thing about him is his close physical resemblance to Cesario; remember that he and his sister are both dressed as men; it is almost impossible to distinguish between them, except by the colors of their clothes. But because Viola recognizes her brother, the attention of this final scene is on Sebastian, who gradually comes to recognize that the youth dressed as Cesario is really Viola. In this recognition scene, then, all parties are happily joined to each other, even though we do not see Sir Toby and Maria, who have just been married, according to Feste.
Malvolio is the only person left disgruntled. There is no humor, no charity, and no forgiveness in him, and after his departure, the play ends on a happy note, with the promise of happiness for almost everyone.