Hamlet, Prince of Denmark, sees his dead father's ghost, who tells him that he was murdered by his brother Claudius, and urges him to take revenge. Claudius is now king and has married Hamlet's mother, Queen Gertrude. Hamlet decides to pretend to be insane while he works out what to do. He rejects his old girlfriend Ophelia, the daughter of Polonius, a lord. He arranges a play to be put on, in which a king is murdered by his nephew. Claudius calls off the performance, seeming guilty or worried. Hamlet talks to his mother in her bedroom, and stabs through a curtain behind which Polonius is hiding, killing him. Claudius sends Hamlet to England with Rosencrantz and Guildenstern, with instructions for them to kill him, but Hamlet escapes and returns to Denmark.
During his absence, Ophelia has gone insane with grief and drowned. Her brother Laertes has returned from France and encounters Hamlet in the graveyard where Ophelia is to be buried. Claudius arranges a duel, giving Laertes a poisoned sword with which to fight Hamlet, also providing a cup of poison for Hamlet to drink. But the swords get mixed up, both Laertes and Hamlet are fatally wounded, and Gertrude accidentally drinks the poison. Before dying, Hamlet manages at last to kill Claudius with the poisoned sword.