Olivia arrives and we see that Orsino still loves her. The feeling is not mutual... Olivia scolds Cesario (Viola) for neglecting her, revealing that "he" is her husband.
Cesario (Viola) amazed by this, pleads "his" innocence to Orsino who "he" truly loves and Orsino thinking his servant betrayed him by taking Olivia for himself, prepares to punish Cesario.
Olivia meanwhile despairs that her husband Cesario who really is Sebastian, would leave willingly with Orsino to be punished rather than be with his wife and she too claims betrayal by Cesario (Viola).
Sebastian arrives, apologizing for attacking Sir Toby and Sir Andrew. Orsino seeing both Cesario and Sebastian together is amazed that he sees two copies of the same man. Olivia too is amazed.
Sebastian and Cesario compare notes on how they arrived in Illyria each claiming that their sibling had drowned.
Eventually they realize that since they knew the same father they are indeed brother and sister, Cesario revealing "his" real identity as the woman named Viola.
Malvolio storms in and the cruel prank against him is revealed by Fabian who confesses.
Orsino calls Olivia his sister, and Orsino takes Cesario for his mistress and we presume later his wife with Feste ending the play in song.