The protagonist of Hamlet is Prince Hamlet of Denmark, son of the recently deceased King Hamlet, and nephew of King Claudius, his father's brother and successor. Claudius hastily married King Hamlet's widow, Gertrude, Hamlet's mother. Denmark has a long-standing feud with neighbouring Norway, and an invasion led by the Norwegian prince, Fortinbras, is expected.
The play opens on a cold winter midnight on "a platform before the castle" of Elsinore, the Danish royal castle. The sentries Bernardo and Marcellus and Hamlet's friend Horatio encounter a ghost that looks like the late King Hamlet. When it declines to talk to them they attack it with daggers, but it escapes. Marcellus admits: "We do it wrong... to offer it the show of violence / For it is... invulnerable." They vow to tell Prince Hamlet that his father's ghost has been seen.
The scene shifts to a "room of state in the castle." Various royal figures come in. Claudius and Gertrude talk with Laertes about his upcoming journey to France. Laertes's father Polonius admits that he has agreed to his son's trip. The King and Queen then turn to Hamlet. Perturbed by Hamlet's continuing deep mourning for his father and his increasingly erratic behaviour, Claudius and Gertrude try to persuade him to be more cheerful. Claudius tells him that it is normal for fathers to die, but the prince is not comforted by this.
When they leave, Hamlet complains in his first soliloquy ("O that this too too solid flesh would melt") that his mother has jumped into "incestuous sheets" with her brother-in-law too quickly after the death of Hamlet's father. Horatio and the sentries come in and Hamlet warmly greets his friend, who has recently returned to court from the university at Wittenberg. The three tell Hamlet about the ghost they have seen at the castle and the prince resolves to see the apparition himself.