The action takes place in the fictional country of Illyria. Duke Orsino is in love with Countess Olivia, but she does not return his feelings as she is mourning the death of her brother and father. Orsino hires a young man named Cesario as his secretary, confiding his romantic secrets in him, unaware that Cesario is actually a girl named Viola.
Viola survived a shipwreck that claimed her brother's life, and in order to search for him, she disguises herself as a man and becomes a servant to the duke. While in the guise of Cesario, Viola performs tasks for Orsino, including delivering love letters to Olivia. Although Viola herself falls in love with the duke, her mission is complicated by the fact that Olivia, upon receiving the letters, begins to fall for Cesario, unaware of her true identity.
The situation becomes more complicated when Sebastian, Viola's twin brother, appears in Illyria. He accidentally defeats Sir Andrew in a duel, and Olivia, mistaking him for Cesario, proposes marriage. Sebastian, not understanding what is happening, agrees.
In the end, all secrets are revealed, and Duke Orsino accepts Viola as his beloved, and everyone finds their happiness.